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

72 lines
1.6 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-03-04 18:40:14 +08:00
using UnityEngine;
2026-03-11 11:40:00 +08:00
public class TestData : ISimpleViewData
{
public string Name;
}
2025-12-26 14:23:01 +08:00
2025-11-13 17:46:33 +08:00
[UIUpdate]
2025-12-26 14:23:01 +08:00
[Window(UILayer.UI, false, 3)]
2025-04-28 19:45:45 +08:00
public class UILoadUpdate : UITabWindow<ui_UILoadUpdateWindow>
2025-03-04 18:40:14 +08:00
{
2026-03-11 11:40:00 +08:00
private UGList<TestData> _list;
2025-12-26 14:23:01 +08:00
2025-10-14 15:42:34 +08:00
protected override void OnInitialize()
{
2026-03-11 11:40:00 +08:00
_list = UGListCreateHelper.Create<TestData>(baseui.ScrollViewTestList, OnItemClick);
2025-11-13 17:46:33 +08:00
baseui.ImgBackGround.color = Color.gray;
baseui.BtnTest.onClick.AddListener(OnTestClick);
2026-03-11 11:40:00 +08:00
List<TestData> testDataList = new List<TestData>();
for (int i = 0; i < 100; i++)
{
testDataList.Add(new TestData() { Name = $"TestProp:{i}" });
}
_list.Data = testDataList;
2025-11-13 17:46:33 +08:00
}
2025-12-26 14:23:01 +08:00
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-10-14 15:42:34 +08:00
}
2025-03-04 18:40:14 +08:00
2026-03-11 11:40:00 +08:00
private void OnItemClick(TestData obj)
{
}
2025-11-17 16:56:03 +08:00
2025-10-14 15:42:34 +08:00
private void OnTestClick()
{
2026-03-11 11:40:00 +08:00
// int index = Random.Range(0, 99);
// Debug.Log(index);
2025-12-26 14:23:01 +08:00
// list.RecyclerView.ScrollTo(index, true);
2025-10-14 15:42:34 +08:00
}
protected override void OnOpen()
{
Debug.Log("OnOpen");
}
protected override void OnClose()
{
Debug.Log("OnClose");
}
2025-12-26 14:23:01 +08:00
protected override void OnDestroy()
{
Debug.Log("OnDestroy");
}
2025-03-04 18:40:14 +08:00
}