48 lines
1.2 KiB
C#
Raw Normal View History

2024-12-14 18:27:59 +08:00
using UnityEngine;
using UnityEngine.UI;
using QFramework;
using DG.Tweening;
using System;
namespace QFramework.Example
{
public class UILoadingData : UIPanelData
{
}
public partial class UILoading : UIPanel
{
protected override void OnInit(IUIData uiData = null)
{
mData = uiData as UILoadingData ?? new UILoadingData();
2025-01-09 09:43:15 +08:00
TypeEventSystem.Global.Register<OnModuleQuit>((arg) => Hide()).UnRegisterWhenGameObjectDestroyed(gameObject);
2025-01-13 09:39:11 +08:00
TypeEventSystem.Global.Register<OnLoadingShow>(arg =>
{
if (gameObject.activeSelf == false)
{
Show();
}
}).UnRegisterWhenGameObjectDestroyed(gameObject);
2024-12-14 18:27:59 +08:00
TypeEventSystem.Global.Register<OnLoadingHide>((arg) => Hide()).UnRegisterWhenGameObjectDestroyed(gameObject);
}
protected override void OnOpen(IUIData uiData = null)
{
Icon.GetComponent<DOTweenAnimation>().DORestart();
}
protected override void OnShow()
{
}
protected override void OnHide()
{
}
protected override void OnClose()
{
}
}
}