using System; using System.Collections.Generic; using AlicizaX; using AlicizaX.Event.Runtime; using AlicizaX.Resource.Runtime; using AlicizaX.UI.RecyclerView; using AlicizaX.UI.Runtime; using Cysharp.Threading.Tasks; using GameLogic.UI; using UnityEngine; [Window(UILayer.UI, false)] public class UILoadUpdate : UITabWindow { private Adapter typeAdapter; private UITestCardWidget _uiTestCardWidget; protected override async UniTask OnInitializeAsync() { Log.Info("OnInitlize"); typeAdapter = new Adapter(baseui.ScrollViewTestList); typeAdapter.SetOnItemClick(OnItemClick); baseui.ScrollViewTestList.SetLayoutManager(new LinearLayoutManager()); InitTabVirtuallyView("UITestCardWidget", baseui.RectTransform); } private void OnItemClick(string obj) { Debug.Log(obj); } protected override void OnRegisterEvent(EventListenerProxy proxy) { base.OnRegisterEvent(proxy); proxy.Subscribe(AssetPatchStatesChangeEventArgs.EventId, SetPatchStates); } private void SetPatchStates(object sender, GameEventArgs e) { Debug.Log("收到信息"); } protected override void OnOpen() { base.OnOpen(); List para = new List(); int count = (int)UserData; for (var i = 0; i < count; i++) { para.Add(i.ToString()); } typeAdapter.SetList(para); Log.Info("OnOpen"); SwitchTab(0); } protected override void OnClose() { base.OnClose(); Log.Info("OnClose"); } protected override void OnDestroy() { base.OnDestroy(); Log.Info("OnDestroy"); } protected override void OnUpdate() { base.OnUpdate(); } }