88 lines
2.6 KiB
C#
88 lines
2.6 KiB
C#
|
|
using ET;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using FairyGUI;
|
|
|
|
namespace ET
|
|
{
|
|
public class TeamRequestUIAwakeSyatem : AwakeSystem<TeamRequestUI,TeamRequestInfo>
|
|
{
|
|
public override void Awake(TeamRequestUI self,TeamRequestInfo info)
|
|
{
|
|
self.Awake(info);
|
|
}
|
|
}
|
|
public class TeamRequestUIDestroySyatem : DestroySystem<TeamRequestUI>
|
|
{
|
|
public override void Destroy(TeamRequestUI self)
|
|
{
|
|
self.Destroy();
|
|
}
|
|
}
|
|
public class TeamRequestUI : Entity
|
|
{
|
|
public FUI_TeamRequest ui;
|
|
|
|
public TeamRequestInfo info;
|
|
private Scene zoneScene;
|
|
|
|
public void Awake(TeamRequestInfo info)
|
|
{
|
|
zoneScene = this.ZoneScene();
|
|
this.info = info;
|
|
ui = GetParent<FUI_TeamRequest>();
|
|
AwakeAsync().Coroutine();
|
|
}
|
|
private async ETVoid AwakeAsync()
|
|
{
|
|
GLabel item = ui.m_list.AddItemFromPool(FUI_LabelTeamRequest.URL).asLabel;
|
|
FUI_LabelTeamRequest itemUi = FUI_LabelTeamRequest.GetFormPool(this.ui, item);
|
|
itemUi.m_progress.value = 100;
|
|
itemUi.m_progress.TweenValue(0, info.timeOut * 0.001f).OnComplete(ClearItem);
|
|
itemUi.m_trans.Play();
|
|
itemUi.m_Title.text = info.type.ToString();
|
|
itemUi.m_Name.text = info.name;
|
|
itemUi.m_Job.text = TabHelper.GetStrJob(info.job);
|
|
itemUi.m_Level.text = info.level.ToString();
|
|
itemUi.m_btnYes.onClick.Set(() =>
|
|
{
|
|
Game.EventSystem.Publish(new ET.EventType.SendHandleInviteTeam
|
|
{
|
|
zoneScene = this.zoneScene,
|
|
type = info.type,
|
|
id=info.Id,
|
|
isAgree=true
|
|
}).Coroutine();
|
|
ClearItem();
|
|
});
|
|
itemUi.m_btnNo.onClick.Set(() =>
|
|
{
|
|
Game.EventSystem.Publish(new ET.EventType.SendHandleInviteTeam
|
|
{
|
|
zoneScene = this.zoneScene,
|
|
type = info.type,
|
|
id = info.Id,
|
|
isAgree = false
|
|
}).Coroutine();
|
|
ClearItem();
|
|
});
|
|
|
|
void ClearItem()
|
|
{
|
|
ui.m_list.RemoveChildToPool(item);
|
|
item.onClick.Clear();
|
|
if (ui.m_list.columnCount == 0)
|
|
{
|
|
ui.GetComponent<FUIWindowComponent>().Window.Hide();
|
|
}
|
|
}
|
|
await ETTask.CompletedTask;
|
|
}
|
|
public void Destroy()
|
|
{
|
|
|
|
}
|
|
}
|
|
}
|