25 lines
858 B
C#
25 lines
858 B
C#
using System;
|
|
|
|
namespace ET
|
|
{
|
|
[ActorMessageHandler]
|
|
public class C2M_ResetPointHandler : AMActorLocationRpcHandler<Unit, C2M_ResetPoint, M2C_ResetPoint>
|
|
{
|
|
protected override async ETTask Run(Unit unit, C2M_ResetPoint request, M2C_ResetPoint response, Action reply)
|
|
{
|
|
if (TeamComponent.Instance.Get(unit.TeamLeaderId).TeamState == TeamState.Fight)
|
|
{
|
|
response.Message = "战斗中...";
|
|
reply();
|
|
return;
|
|
}
|
|
CharacterHelper.ResetPoint(unit);
|
|
CharacterHelper.SyncNumeric(unit);
|
|
UnitHelper.Save<PlayerData>(unit).Coroutine();
|
|
UnitHelper.Save<NumericComponent>(unit).Coroutine();
|
|
response.Character =await CharacterHelper.GetUnitCharacter(unit);
|
|
reply();
|
|
await ETTask.CompletedTask;
|
|
}
|
|
}
|
|
} |