forked from sin365/AxibugEmuOnline
迭代
This commit is contained in:
parent
1c589ac3be
commit
7b85fd8ce8
@ -23,27 +23,6 @@ namespace AxibugEmuOnline.Client
|
||||
public int Index { get; set; }
|
||||
public int roomID { get; private set; }
|
||||
|
||||
protected override void Awake()
|
||||
{
|
||||
base.Awake();
|
||||
|
||||
Eventer.Instance.RegisterEvent<int>(EEvent.OnRoomListSingleUpdate, OnRoomSingleUpdate);
|
||||
}
|
||||
|
||||
protected override void OnDestroy()
|
||||
{
|
||||
Eventer.Instance.UnregisterEvent<int>(EEvent.OnRoomListSingleUpdate, OnRoomSingleUpdate);
|
||||
}
|
||||
|
||||
private void OnRoomSingleUpdate(int roomId)
|
||||
{
|
||||
if (roomId != roomID) return;
|
||||
|
||||
if (App.roomMgr.GetRoomListMiniInfo(roomId, out var roomInfo))
|
||||
{
|
||||
UpdateUI(roomInfo);
|
||||
}
|
||||
}
|
||||
|
||||
public void SetData(object data)
|
||||
{
|
||||
|
@ -12,6 +12,7 @@ namespace AxibugEmuOnline.Client
|
||||
{
|
||||
Eventer.Instance.RegisterEvent<int>(EEvent.OnRoomListAllUpdate, OnRoomListUpdateAll);
|
||||
Eventer.Instance.RegisterEvent<int>(EEvent.OnRoomListSingleClose, OnRoomClosed);
|
||||
Eventer.Instance.RegisterEvent<int>(EEvent.OnRoomListSingleUpdate, OnRoomSingleUpdate);
|
||||
base.Awake();
|
||||
}
|
||||
|
||||
@ -19,6 +20,7 @@ namespace AxibugEmuOnline.Client
|
||||
protected override void OnDestroy()
|
||||
{
|
||||
Eventer.Instance.UnregisterEvent<int>(EEvent.OnRoomListAllUpdate, OnRoomListUpdateAll);
|
||||
Eventer.Instance.UnregisterEvent<int>(EEvent.OnRoomListSingleUpdate, OnRoomSingleUpdate);
|
||||
Eventer.Instance.UnregisterEvent<int>(EEvent.OnRoomListSingleClose, OnRoomClosed);
|
||||
}
|
||||
|
||||
@ -36,6 +38,14 @@ namespace AxibugEmuOnline.Client
|
||||
return res;
|
||||
}
|
||||
|
||||
private void OnRoomSingleUpdate(int obj)
|
||||
{
|
||||
if (m_entering)
|
||||
{
|
||||
RefreshUI();
|
||||
}
|
||||
}
|
||||
|
||||
private void OnRoomListUpdateAll(int obj)
|
||||
{
|
||||
if (m_entering)
|
||||
|
Loading…
Reference in New Issue
Block a user