From 4933c99c076b2678a18615335f75d9cee6bec197 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=BC=A0=E9=93=AE?= <834207172@qq.com>
Date: Tue, 14 Oct 2025 14:29:08 +0800
Subject: [PATCH] 111
---
.../Tools/PanelSystem/Base/BasePanel.cs | 72 +++++++++++++++----
.../Tools/PanelSystem/Manager/PanelSystem.cs | 6 ++
.../Runtime/VideoSystemPanel/VideoPanel.cs | 6 +-
Assets/00.StaryEvoTools/package.json | 2 +-
4 files changed, 69 insertions(+), 17 deletions(-)
diff --git a/Assets/00.StaryEvoTools/Runtime/Tools/PanelSystem/Base/BasePanel.cs b/Assets/00.StaryEvoTools/Runtime/Tools/PanelSystem/Base/BasePanel.cs
index 3f22a7f..f8a0ff0 100644
--- a/Assets/00.StaryEvoTools/Runtime/Tools/PanelSystem/Base/BasePanel.cs
+++ b/Assets/00.StaryEvoTools/Runtime/Tools/PanelSystem/Base/BasePanel.cs
@@ -1,4 +1,5 @@
-using System.Collections.Generic;
+using System;
+using System.Collections.Generic;
using System.Threading.Tasks;
using DG.Tweening;
using UnityEngine;
@@ -6,6 +7,7 @@ using UnityEngine.UI;
#if HotUpdate
using YooAsset;
#endif
+
namespace Stary.Evo.UIFarme
{
public interface IBasePanel : IController
@@ -14,6 +16,7 @@ namespace Stary.Evo.UIFarme
/// UI信息
///
string UIName { get; set; }
+
///
/// 绑定这个面板的实例
///
@@ -28,7 +31,7 @@ namespace Stary.Evo.UIFarme
///
/// 虚方法,UI进入时执行的操作,只会执行一次
///
- void OnEnter();
+ void OnEnter(Action complete = null);
///
/// 虚方法,UI暂停时执行的操作,只会执行一次
@@ -74,6 +77,8 @@ namespace Stary.Evo.UIFarme
///
public string UIName { get; set; }
+ public abstract UITweenType TweenType { get; }
+
///
/// 面板管理器
///
@@ -118,11 +123,27 @@ namespace Stary.Evo.UIFarme
}
- public virtual void OnEnter()
+ public virtual void OnEnter(Action complete = null)
{
activePanel.SetActive(true);
canvasGroup.blocksRaycasts = true;
- canvasGroup.DOFade(1f, 1f);
+ if (TweenType == UITweenType.Fade)
+ {
+ canvasGroup.alpha = 1f;
+ }
+
+ if (TweenType == UITweenType.Fade)
+ {
+ canvasGroup.DOFade(1f, 2f).OnComplete(() => { complete?.Invoke(); });
+ }
+ else if (TweenType == UITweenType.Yoyo)
+ {
+ canvasGroup.DOFade(1, 2f).SetLoops(2, LoopType.Yoyo).OnComplete(() => { complete?.Invoke(); });
+ }
+ else
+ {
+ canvasGroup.DOFade(1, 2f).SetLoops(-1).OnComplete(() => { complete?.Invoke(); });
+ }
}
public virtual void OnPause()
@@ -169,15 +190,15 @@ namespace Stary.Evo.UIFarme
}
else
{
- var package = YooAssets.TryGetPackage(packageName);
- if (package == null)
- {
- handle = YooAssets.LoadAssetAsync(panelName);
- }
- else
- {
- handle = package.LoadAssetAsync(panelName);
- }
+ var package = YooAssets.TryGetPackage(packageName);
+ if (package == null)
+ {
+ handle = YooAssets.LoadAssetAsync(panelName);
+ }
+ else
+ {
+ handle = package.LoadAssetAsync(panelName);
+ }
}
await handle.Task;
@@ -192,7 +213,7 @@ namespace Stary.Evo.UIFarme
activePanel.name = this.GetType().Name;
- if (!activePanel.GetComponentInChildren