using System.Collections.Generic; using AlicizaX; using AlicizaX.Resource.Runtime; using AlicizaX.UI; using AlicizaX.UI.Runtime; using Cysharp.Threading.Tasks; using Game.UI; using GameLogic.Event; using UnityEngine; public class TestData : ISimpleViewData { public string Name; } [UIUpdate] [Window(UILayer.UI, false, 3)] public class UILoadUpdate : UITabWindow { private UGList _list; protected override void OnInitialize() { _list = UGListCreateHelper.Create(baseui.ScrollViewTestList, OnItemClick); baseui.ImgBackGround.color = Color.gray; baseui.BtnTest.onClick.AddListener(OnTestClick); List testDataList = new List(); for (int i = 0; i < 100; i++) { testDataList.Add(new TestData() { Name = $"TestProp:{i}" }); } _list.Data = testDataList; } protected override void OnRegisterEvent(EventListenerProxy proxy) { proxy.AddUIEvent(OnHandleTestUIOpenEevent); } private void OnHandleTestUIOpenEevent(TestUIOpenEvent obj) { } private void OnItemClick(TestData obj) { } private void OnTestClick() { // int index = Random.Range(0, 99); // Debug.Log(index); // list.RecyclerView.ScrollTo(index, true); } protected override void OnOpen() { Debug.Log("OnOpen"); } protected override void OnClose() { Debug.Log("OnClose"); } protected override void OnDestroy() { Debug.Log("OnDestroy"); } }