AlicizaX/Client/Assets/Scripts/Hotfix/GameLogic/UILoadUpdate.cs
2025-04-28 19:45:45 +08:00

76 lines
1.8 KiB
C#

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<ui_UILoadUpdateWindow>
{
private Adapter<string> typeAdapter;
private UITestCardWidget _uiTestCardWidget;
protected override async UniTask OnInitializeAsync()
{
Log.Info("OnInitlize");
typeAdapter = new Adapter<string>(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<string> para = new List<string>();
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();
}
}