2021-04-08 20:09:59 +08:00
|
|
|
|
|
|
|
|
|
using Cal.DataTable;
|
|
|
|
|
using ET;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
2021-04-11 19:50:39 +08:00
|
|
|
|
using FairyGUI;
|
2021-04-08 20:09:59 +08:00
|
|
|
|
|
|
|
|
|
namespace ET
|
|
|
|
|
{
|
|
|
|
|
public class PvpBoardUIAwakeSyatem : AwakeSystem<PvpBoardUI>
|
|
|
|
|
{
|
|
|
|
|
public override void Awake(PvpBoardUI self)
|
|
|
|
|
{
|
|
|
|
|
self.Awake();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
public class PvpBoardUIDestroySyatem : DestroySystem<PvpBoardUI>
|
|
|
|
|
{
|
|
|
|
|
public override void Destroy(PvpBoardUI self)
|
|
|
|
|
{
|
|
|
|
|
self.Destroy();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
public class PvpBoardUI : Entity
|
|
|
|
|
{
|
|
|
|
|
public FUI_PvpBoardUI ui;
|
2021-04-20 00:25:04 +08:00
|
|
|
|
private Scene zoneScene;
|
|
|
|
|
|
2021-04-08 20:09:59 +08:00
|
|
|
|
public void Awake()
|
|
|
|
|
{
|
2021-04-20 00:25:04 +08:00
|
|
|
|
zoneScene = this.ZoneScene();
|
2021-04-08 20:09:59 +08:00
|
|
|
|
ui = GetParent<FUI_PvpBoardUI>();
|
|
|
|
|
AwakeAsync().Coroutine();
|
|
|
|
|
}
|
|
|
|
|
private async ETVoid AwakeAsync()
|
|
|
|
|
{
|
2021-04-20 00:25:04 +08:00
|
|
|
|
M2C_GetPvpBoardInfo ret = await zoneScene.GetComponent<SessionComponent>().Call<M2C_GetPvpBoardInfo>(new C2M_GetPvpBoardInfo { });
|
2021-04-08 20:09:59 +08:00
|
|
|
|
if (!ret.Message.IsNullOrEmpty())
|
|
|
|
|
{
|
|
|
|
|
TipHelper.OpenUI(ret.Message);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
ui.m_txtScord.text = "积分:"+ret.scord;
|
|
|
|
|
ui.m_txtMatchCount.text = "当前匹配人数:"+ret.matchCount;
|
|
|
|
|
ui.m_txtBattleCount.text = $"战斗次数:{ret.battleCount}/100";
|
|
|
|
|
ui.m_btnMatch.Visible = !ret.isMatch;
|
|
|
|
|
ui.m_btnMatch.self.onClick.Set(() =>
|
|
|
|
|
{
|
|
|
|
|
OnReQestMathch().Coroutine();
|
|
|
|
|
});
|
|
|
|
|
ui.m_list.RemoveChildrenToPool();
|
|
|
|
|
int rank = 0;
|
2021-04-11 19:50:39 +08:00
|
|
|
|
foreach (PvpRankInfo item in ret.rankList)
|
2021-04-08 20:09:59 +08:00
|
|
|
|
{
|
2021-04-11 19:50:39 +08:00
|
|
|
|
GObject go = ui.m_list.AddItemFromPool();
|
2021-04-08 20:09:59 +08:00
|
|
|
|
FUI_LabelPvpRankItem label = FUI_LabelPvpRankItem.GetFormPool(ui.DomainScene(),go);
|
|
|
|
|
label.m_txtRank.text = ++rank + string.Empty;
|
|
|
|
|
label.m_txtName.text = item.name;
|
|
|
|
|
label.m_txtLevel.text = item.level+string.Empty;
|
|
|
|
|
label.m_txtScord.text = item.scord+string.Empty;
|
|
|
|
|
}
|
|
|
|
|
await ETTask.CompletedTask;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private async ETVoid OnReQestMathch()
|
|
|
|
|
{
|
|
|
|
|
ui.m_btnMatch.Visible = false;
|
2021-04-20 00:25:04 +08:00
|
|
|
|
M2C_RequestPersonalPvp ret = await zoneScene.GetComponent<SessionComponent>().Call<M2C_RequestPersonalPvp>(new C2M_RequestPersonalPvp { });
|
2021-04-08 20:09:59 +08:00
|
|
|
|
if (!ret.Message.IsNullOrEmpty())
|
|
|
|
|
{
|
|
|
|
|
TipHelper.OpenUI(ret.Message);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void Destroy()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|