28 lines
796 B
C#
28 lines
796 B
C#
using System;
|
|
|
|
namespace ET
|
|
{
|
|
[ActorMessageHandler]
|
|
public class C2M_BackMainCityHandler : AMActorLocationRpcHandler<Unit, C2M_BackMainCity, M2C_BackMainCity>
|
|
{
|
|
|
|
protected override async ETTask Run(Unit unit, C2M_BackMainCity request, M2C_BackMainCity response, Action reply)
|
|
{
|
|
|
|
if (!unit.IsTeamLeader)
|
|
{
|
|
response.Message = "你不是队长!";
|
|
reply();
|
|
return;
|
|
}
|
|
if (unit.GetComponent<PlayerData>().IsBattleIdle)
|
|
{
|
|
response.Message = "挂机中!";
|
|
reply();
|
|
return;
|
|
}
|
|
await Game.EventSystem.Publish(new EventType.BackMainCity { unit = unit });
|
|
reply();
|
|
}
|
|
}
|
|
} |