From 475b206cf957b12155df53502cb33c96acd49a0a Mon Sep 17 00:00:00 2001 From: m0_75251201 Date: Thu, 10 Jul 2025 11:26:56 +0800 Subject: [PATCH] =?UTF-8?q?(client)=20fix:=E4=BF=AE=E6=94=B9Clock=E6=9A=82?= =?UTF-8?q?=E5=81=9C=E9=80=9A=E8=BF=87=E5=AD=97=E6=AE=B5=E8=AE=BF=E9=97=AE?= =?UTF-8?q?=EF=BC=8C=E5=B9=B6=E8=AE=A9=E6=9A=82=E5=81=9C=E5=8F=AF=E6=9A=82?= =?UTF-8?q?=E5=81=9C=E7=89=A9=E7=90=86=E5=BC=95=E6=93=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Client/Assets/Scripts/Base/Clock.cs | 25 ++++++++++++++++++++--- Client/Assets/Scripts/Data.meta | 8 ++++++++ Client/Assets/Scripts/Data/Define.cs | 9 ++++++++ Client/Assets/Scripts/Data/Define.cs.meta | 2 ++ 4 files changed, 41 insertions(+), 3 deletions(-) create mode 100644 Client/Assets/Scripts/Data.meta create mode 100644 Client/Assets/Scripts/Data/Define.cs create mode 100644 Client/Assets/Scripts/Data/Define.cs.meta diff --git a/Client/Assets/Scripts/Base/Clock.cs b/Client/Assets/Scripts/Base/Clock.cs index 8adde8e..af12744 100644 --- a/Client/Assets/Scripts/Base/Clock.cs +++ b/Client/Assets/Scripts/Base/Clock.cs @@ -28,14 +28,33 @@ namespace Base public class Clock : MonoSingleton { - public bool pause; + private bool _pause = false; + public bool Pause + { + get + { + return _pause; + } + set + { + if (value) + { + Time.timeScale = 0; + } + else + { + Time.timeScale = 1; + } + _pause = value; + } + } public List tickPhysics = new(); public List ticks = new(); public List tickUIs = new(); private void Update() { - if (!pause) + if (!_pause) foreach (var tick in ticks) tick.Tick(); @@ -50,7 +69,7 @@ namespace Base private void FixedUpdate() { - if (!pause) + if (!_pause) foreach (var physicsTick in tickPhysics) physicsTick.TickPhysics(); } diff --git a/Client/Assets/Scripts/Data.meta b/Client/Assets/Scripts/Data.meta new file mode 100644 index 0000000..1b14b98 --- /dev/null +++ b/Client/Assets/Scripts/Data.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 7ba97aadae8c43847b4202b29f134ae7 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Client/Assets/Scripts/Data/Define.cs b/Client/Assets/Scripts/Data/Define.cs new file mode 100644 index 0000000..9a2b26b --- /dev/null +++ b/Client/Assets/Scripts/Data/Define.cs @@ -0,0 +1,9 @@ + +namespace Data +{ + public class Define + { + + } + +} \ No newline at end of file diff --git a/Client/Assets/Scripts/Data/Define.cs.meta b/Client/Assets/Scripts/Data/Define.cs.meta new file mode 100644 index 0000000..7a85e53 --- /dev/null +++ b/Client/Assets/Scripts/Data/Define.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 1bce40c195d0b8c40bd564447c84cf21 \ No newline at end of file