You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
1.1 KiB
36 lines
1.1 KiB
using System; |
|
|
|
namespace ET |
|
{ |
|
|
|
public class C2M_ChangeBehaveHandler: AMActorLocationRpcHandler<Unit, C2M_ChangeBehave, M2C_ChangeBehave> |
|
{ |
|
protected async override ETTask Run(Unit unit, C2M_ChangeBehave request, M2C_ChangeBehave response, Action reply) |
|
{ |
|
try |
|
{ |
|
People people = unit.GetComponent<PeopleComponent>().GetChild<People>(request.PeopleId); |
|
if (people != null) |
|
{ |
|
PeopleOperate.ChangeBehave(unit, people, request.BehaveType, request.TargetId); |
|
response.Error = ErrorCode.ERR_Success; |
|
} |
|
else |
|
{ |
|
response.Error = ErrorCode.ERR_PeopleMoveFail; |
|
} |
|
reply(); |
|
|
|
} |
|
catch (Exception e) |
|
{ |
|
response.Message = e.ToString(); |
|
response.Error = ErrorCode.ERR_PeopleMoveFail; |
|
reply(); |
|
} |
|
|
|
await ETTask.CompletedTask; |
|
|
|
} |
|
} |
|
} |