AlicizaX/Client/Assets/Scripts/Hotfix/GameLogic/UI/UILoadUpdate.cs

81 lines
1.7 KiB
C#
Raw Normal View History

2025-12-01 16:46:28 +08:00
using System.Collections.Generic;
2025-11-13 17:46:33 +08:00
using AlicizaX;
using AlicizaX.Resource.Runtime;
2025-12-01 16:46:28 +08:00
using AlicizaX.UI;
2025-03-04 18:40:14 +08:00
using AlicizaX.UI.Runtime;
2025-11-13 17:46:33 +08:00
using Cysharp.Threading.Tasks;
2025-11-07 20:48:24 +08:00
using Game.UI;
2025-11-13 17:46:33 +08:00
using GameLogic.Event;
2025-11-17 16:56:03 +08:00
using GameLogic.UI;
2025-03-04 18:40:14 +08:00
using UnityEngine;
2025-11-13 17:46:33 +08:00
[UIUpdate]
[Window(UILayer.UI, false, 160)]
2025-04-28 19:45:45 +08:00
public class UILoadUpdate : UITabWindow<ui_UILoadUpdateWindow>
2025-03-04 18:40:14 +08:00
{
2025-11-17 16:56:03 +08:00
private UICardWidget testa;
private UICardWidget testb;
2025-10-14 15:42:34 +08:00
protected override void OnInitialize()
{
2025-11-13 17:46:33 +08:00
baseui.ImgBackGround.color = Color.gray;
baseui.BtnTest.onClick.AddListener(OnTestClick);
2025-11-17 16:56:03 +08:00
CreateTest();
2025-11-13 17:46:33 +08:00
}
protected override void OnRegisterEvent(EventListenerProxy proxy)
{
2025-11-14 11:38:43 +08:00
proxy.AddUIEvent<TestUIOpenEvent>(OnHandleTestUIOpenEevent);
2025-11-13 17:46:33 +08:00
}
private void OnHandleTestUIOpenEevent(TestUIOpenEvent obj)
{
2025-11-18 16:15:26 +08:00
2025-10-14 15:42:34 +08:00
}
2025-03-04 18:40:14 +08:00
2025-11-17 16:56:03 +08:00
private void CreateTest()
{
testa= CreateWidgetSync<UICardWidget>(baseui.RectTransform);
testb=CreateWidgetSync<UICardWidget>(baseui.RectTransform);
GameApp.Timer.AddTimer((t) =>
{
DestroyTest();
}, 5f);
}
private void DestroyTest()
{
testa.Destroy();
testb.Destroy();
GameApp.Timer.AddTimer((t) =>
{
CreateTest();
}, 10f);
}
2025-10-14 15:42:34 +08:00
private void OnTestClick()
{
2025-11-13 17:46:33 +08:00
EventPublisher.Publish(new TestUIOpenEvent("Test", false));
2025-10-14 15:42:34 +08:00
}
2025-11-13 17:46:33 +08:00
public async UniTask TestFuncA()
{
await UniTask.Delay(1000);
Debug.Log("TestFuncA");
}
public void TestFuncB()
{
TestFuncA();
Debug.Log("TestFuncB");
}
2025-10-14 15:42:34 +08:00
protected override void OnOpen()
{
Debug.Log("OnOpen");
}
protected override void OnClose()
{
Debug.Log("OnClose");
}
2025-03-04 18:40:14 +08:00
}