From 6a5dc9458b432ebf5d1f325e4fd34495ecd6ef22 Mon Sep 17 00:00:00 2001 From: ZayNepz <116749633+ZayNepz@users.noreply.github.com> Date: Sun, 8 Jun 2025 01:20:19 +0300 Subject: [PATCH] Update AnimationUI.cs Quick fix on a null reference --- Assets/AnimationUI/Script/AnimationUI.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Assets/AnimationUI/Script/AnimationUI.cs b/Assets/AnimationUI/Script/AnimationUI.cs index 013b4a6..7e9faf1 100644 --- a/Assets/AnimationUI/Script/AnimationUI.cs +++ b/Assets/AnimationUI/Script/AnimationUI.cs @@ -76,7 +76,10 @@ public void PlayReversed() [ContextMenu("Stop Animation")] public void Stop() { - foreach(Coroutine coroutine in _coroutines)StopCoroutine(coroutine); + foreach(Coroutine coroutine in _coroutines) + { + if(coroutine != null)StopCoroutine(coroutine); + } _coroutines.Clear(); } @@ -1592,4 +1595,4 @@ void UnityEvent(float t) // Great work. // c0M1NG_d4rkn3SS} -} \ No newline at end of file +}