From ac01ee34dcb1cf66288b94eeb478bd7ddfedaec1 Mon Sep 17 00:00:00 2001 From: sega Date: Tue, 9 Jun 2026 16:11:35 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D1=80=D0=B0=D0=B1=D0=BE=D1=82?= =?UTF-8?q?=D0=BA=D0=B0=20=D0=BE=D1=82=D0=BC=D0=B5=D0=BD=D1=8B=20=D0=BF?= =?UTF-8?q?=D1=80=D0=BE=D1=86=D0=B5=D1=81=D1=81=D0=B0=20=D0=B2=D1=8B=D1=85?= =?UTF-8?q?=D0=BE=D0=B4=D0=B0=20=D0=BF=D0=BE=20=D1=82=D0=B0=D0=B9=D0=BC?= =?UTF-8?q?=D0=B5=D1=80=D1=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scripts/Awards/AwardsController.cs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Assets/Scripts/Awards/AwardsController.cs b/Assets/Scripts/Awards/AwardsController.cs index 8f1ce68..96b4562 100644 --- a/Assets/Scripts/Awards/AwardsController.cs +++ b/Assets/Scripts/Awards/AwardsController.cs @@ -46,6 +46,7 @@ public class AwardsController : MonoBehaviour private bool polling = false; + private CancellationTokenSource timerCts; async void Start() { if (!BootstrapperState.MainBootstraped) @@ -79,8 +80,11 @@ public class AwardsController : MonoBehaviour polling = true; //Запустить таймер + + timerCts = new CancellationTokenSource(); + ShowTimer(); - WaitTimeoutNExit(this.GetCancellationTokenOnDestroy()).Forget(); + WaitTimeoutNExit(timerCts.Token).Forget(); } private void Update() @@ -88,6 +92,7 @@ public class AwardsController : MonoBehaviour if (!polling) return; if (In.GetButtonDown(InSignal.DownRight)) { + CancelToken(); SceneLoader.LoadScene(menuSceneName); } if (In.GetButtonDown(InSignal.UpRight)) @@ -97,11 +102,19 @@ public class AwardsController : MonoBehaviour { CountersSystem.Increment(CountersSystem.CounterType.TotalStarts); CountersSystem.Increment(CountersSystem.CounterType.StartsFromRevenge); + CancelToken(); SceneLoader.LoadScene(gameplaySceneName); } } } + private void CancelToken() + { + timerCts?.Cancel(); + timerCts?.Dispose(); + timerCts = null; + } + private void Setup() { canvas.worldCamera = CamerasManager.Screen_Camera; @@ -175,6 +188,7 @@ public class AwardsController : MonoBehaviour break; } } + Debug.Log("Таймер убит"); } private async UniTask DisplayRankName()