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

76 lines
1.8 KiB
C#
Raw Normal View History

2025-03-04 18:40:14 +08:00
using System;
using System.Collections.Generic;
2025-04-28 19:45:45 +08:00
using AlicizaX;
using AlicizaX.Event.Runtime;
using AlicizaX.Resource.Runtime;
using AlicizaX.UI.RecyclerView;
2025-03-04 18:40:14 +08:00
using AlicizaX.UI.Runtime;
2025-04-28 19:45:45 +08:00
using Cysharp.Threading.Tasks;
using GameLogic.UI;
2025-03-04 18:40:14 +08:00
using UnityEngine;
2025-04-28 19:45:45 +08:00
[Window(UILayer.UI, false)]
public class UILoadUpdate : UITabWindow<ui_UILoadUpdateWindow>
2025-03-04 18:40:14 +08:00
{
2025-04-28 19:45:45 +08:00
private Adapter<string> typeAdapter;
private UITestCardWidget _uiTestCardWidget;
2025-03-04 18:40:14 +08:00
2025-04-28 19:45:45 +08:00
protected override async UniTask OnInitializeAsync()
2025-03-04 18:40:14 +08:00
{
Log.Info("OnInitlize");
2025-04-28 19:45:45 +08:00
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("收到信息");
2025-03-04 18:40:14 +08:00
}
protected override void OnOpen()
{
base.OnOpen();
2025-04-28 19:45:45 +08:00
List<string> para = new List<string>();
int count = (int)UserData;
for (var i = 0; i < count; i++)
{
para.Add(i.ToString());
}
typeAdapter.SetList(para);
2025-03-04 18:40:14 +08:00
Log.Info("OnOpen");
2025-04-28 19:45:45 +08:00
SwitchTab(0);
2025-03-04 18:40:14 +08:00
}
protected override void OnClose()
{
base.OnClose();
Log.Info("OnClose");
}
protected override void OnDestroy()
{
base.OnDestroy();
Log.Info("OnDestroy");
}
protected override void OnUpdate()
{
base.OnUpdate();
}
}