fix(save): 读档前恢复 timeScale 并用 unscaledTime 淡入
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -7,10 +7,15 @@ namespace AibisDream.Framework
|
||||
{
|
||||
public static class FadeKit
|
||||
{
|
||||
public static IEnumerator FadeInAsync(this Image image, float duration)
|
||||
public static IEnumerator FadeInAsync(this Image image, float duration, bool useUnscaledTime = false)
|
||||
{
|
||||
image.gameObject.SetActive(true);
|
||||
var tweener = image.DOBlendableColor(Color.white, duration);
|
||||
if (useUnscaledTime)
|
||||
{
|
||||
tweener.SetUpdate(true);
|
||||
}
|
||||
|
||||
yield return tweener.WaitForCompletion();
|
||||
}
|
||||
|
||||
@@ -20,10 +25,15 @@ namespace AibisDream.Framework
|
||||
var tweener = image.DOBlendableColor(Color.white, duration);
|
||||
}
|
||||
|
||||
public static IEnumerator FadeOutAsync(this Image image, float duration)
|
||||
public static IEnumerator FadeOutAsync(this Image image, float duration, bool useUnscaledTime = false)
|
||||
{
|
||||
image.gameObject.SetActive(true);
|
||||
var tweener = image.DOBlendableColor(Color.clear, duration);
|
||||
if (useUnscaledTime)
|
||||
{
|
||||
tweener.SetUpdate(true);
|
||||
}
|
||||
|
||||
yield return tweener.WaitForCompletion();
|
||||
image.gameObject.SetActive(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user