2021-04-08 20:09:59 +08:00
|
|
|
|
using ET;
|
|
|
|
|
using ET.EventType;
|
|
|
|
|
|
|
|
|
|
namespace ET
|
|
|
|
|
{
|
|
|
|
|
public class ClickBattleTargetEvent: AEvent<ClickBattleTarget>
|
|
|
|
|
{
|
|
|
|
|
public override async ETTask Run(ClickBattleTarget args)
|
2021-04-20 00:25:04 +08:00
|
|
|
|
{
|
|
|
|
|
var zoneScene = args.zoneScene;
|
2021-04-08 20:09:59 +08:00
|
|
|
|
switch (args.unitType)
|
|
|
|
|
{
|
|
|
|
|
case UnitType.Enermy:
|
|
|
|
|
{
|
2021-04-20 00:25:04 +08:00
|
|
|
|
M2C_SelectEnermy ret = await zoneScene.GetComponent<SessionComponent>().Call<M2C_SelectEnermy>(new C2M_SelectEnermy { Id = zoneScene.GetComponent<GlobalVariable>().SelectBattleUnitId });
|
2021-04-08 20:09:59 +08:00
|
|
|
|
if (!ret.Message.IsNullOrEmpty())
|
|
|
|
|
{
|
|
|
|
|
Game.EventSystem.Publish(new ET.EventType.ShowTipUI
|
|
|
|
|
{
|
|
|
|
|
tip = ret.Message
|
|
|
|
|
}).Coroutine();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case UnitType.TeamMember:
|
|
|
|
|
{
|
2021-04-20 00:25:04 +08:00
|
|
|
|
M2C_SelectTeamMember ret = await zoneScene.GetComponent<SessionComponent>().Call<M2C_SelectTeamMember>(new C2M_SelectTeamMember { Id = zoneScene.GetComponent<GlobalVariable>().SelectBattleUnitId });
|
2021-04-08 20:09:59 +08:00
|
|
|
|
if (!ret.Message.IsNullOrEmpty())
|
|
|
|
|
{
|
|
|
|
|
Game.EventSystem.Publish(new ET.EventType.ShowTipUI
|
|
|
|
|
{
|
|
|
|
|
tip = ret.Message
|
|
|
|
|
}).Coroutine();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|