From 365ab9abc907c9394767cf8f9d65541dd053f388 Mon Sep 17 00:00:00 2001 From: TruthZY <118866375+TruthZY@users.noreply.github.com> Date: Wed, 22 Nov 2023 13:49:57 +0800 Subject: [PATCH] Update ScreenFader.cs --- .../3DGamekit/Packages/SceneManagement/Runtime/ScreenFader.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Assets/3DGamekit/Packages/SceneManagement/Runtime/ScreenFader.cs b/Assets/3DGamekit/Packages/SceneManagement/Runtime/ScreenFader.cs index 5d7bd0a4..1edd9fc8 100644 --- a/Assets/3DGamekit/Packages/SceneManagement/Runtime/ScreenFader.cs +++ b/Assets/3DGamekit/Packages/SceneManagement/Runtime/ScreenFader.cs @@ -68,7 +68,7 @@ protected IEnumerator Fade(float finalAlpha, CanvasGroup canvasGroup) m_IsFading = true; canvasGroup.blocksRaycasts = true; float fadeSpeed = Mathf.Abs(canvasGroup.alpha - finalAlpha) / fadeDuration; - while (!Mathf.Approximately(canvasGroup.alpha, finalAlpha)) + while (Mathf.Abs(canvasGroup.alpha - finalAlpha) > 0.1f) { canvasGroup.alpha = Mathf.MoveTowards(canvasGroup.alpha, finalAlpha, fadeSpeed * Time.deltaTime); @@ -120,4 +120,4 @@ public static IEnumerator FadeSceneOut(FadeType fadeType = FadeType.Black) yield return Instance.StartCoroutine(Instance.Fade(1f, canvasGroup)); } } -} \ No newline at end of file +}