增加LoadingPanel的动画

This commit is contained in:
Wurui
2025-11-08 15:42:56 +08:00
parent 14886090c8
commit 4caa18e3fe
8 changed files with 24 additions and 68 deletions

View File

@@ -2,6 +2,7 @@ using UnityEngine;
using UnityEngine.UI;
using A2W;
using Cysharp.Threading.Tasks;
using DG.Tweening;
public class LaunchPanel : UIPanel
{

View File

@@ -3,6 +3,7 @@ using System.Collections.Generic;
using UnityEngine;
using Cysharp.Threading.Tasks;
using A2W;
using DG.Tweening;
public class LoadingPanel : UIPanel, ITransition
{
@@ -21,14 +22,13 @@ public class LoadingPanel : UIPanel, ITransition
{
isDirty = true;
//Tween tween = canvasGroup.DOFade(1, 0.2f);
Tween tween = canvasGroup.DOFade(1, 0.2f);
while (tween != null && tween.active && !tween.IsComplete())
{
await UniTask.Yield();
}
//while (tween != null && tween.active && !tween.IsComplete())
//{
// await UniTask.Yield();
//}
canvasGroup.alpha = 1;
//canvasGroup.alpha = 1;
isDirty = false;
@@ -39,14 +39,13 @@ public class LoadingPanel : UIPanel, ITransition
{
isDirty = true;
//Tween tween = canvasGroup.DOFade(0, 0.2f);
Tween tween = canvasGroup.DOFade(0, 0.2f);
while (tween != null && tween.active && !tween.IsComplete())
{
await UniTask.Yield();
}
//while (tween != null && tween.active && !tween.IsComplete())
//{
// await UniTask.Yield();
//}
canvasGroup.alpha = 0;
//canvasGroup.alpha = 0;
isDirty = false;