42 lines
1.5 KiB
C#
42 lines
1.5 KiB
C#
|
using ET;
|
|||
|
using ET.EventType;
|
|||
|
|
|||
|
namespace ET
|
|||
|
{
|
|||
|
public class ClickBattleTargetEvent: AEvent<ClickBattleTarget>
|
|||
|
{
|
|||
|
public override async ETTask Run(ClickBattleTarget args)
|
|||
|
{
|
|||
|
switch (args.unitType)
|
|||
|
{
|
|||
|
case UnitType.Enermy:
|
|||
|
{
|
|||
|
var ret = await SessionComponent.Instance.Call<M2C_SelectEnermy>(new C2M_SelectEnermy { Id = GlobalVariable.SelectBattleUnitId });
|
|||
|
if (!ret.Message.IsNullOrEmpty())
|
|||
|
{
|
|||
|
Game.EventSystem.Publish(new ET.EventType.ShowTipUI
|
|||
|
{
|
|||
|
tip = ret.Message
|
|||
|
}).Coroutine();
|
|||
|
return;
|
|||
|
}
|
|||
|
|
|||
|
}
|
|||
|
break;
|
|||
|
case UnitType.TeamMember:
|
|||
|
{
|
|||
|
var ret = await SessionComponent.Instance.Call<M2C_SelectTeamMember>(new C2M_SelectTeamMember { Id = GlobalVariable.SelectBattleUnitId });
|
|||
|
if (!ret.Message.IsNullOrEmpty())
|
|||
|
{
|
|||
|
Game.EventSystem.Publish(new ET.EventType.ShowTipUI
|
|||
|
{
|
|||
|
tip = ret.Message
|
|||
|
}).Coroutine();
|
|||
|
return;
|
|||
|
}
|
|||
|
}
|
|||
|
break;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|