24 lines
758 B
C#
24 lines
758 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace ET
|
|
{
|
|
|
|
[ActorMessageHandler]
|
|
public class C2M_GetPetInfoHandler : AMActorLocationRpcHandler<Unit, C2M_GetPetInfo, M2C_GetPetInfo>
|
|
{
|
|
protected override async ETTask Run(Unit unit, C2M_GetPetInfo request, M2C_GetPetInfo response, Action reply)
|
|
{
|
|
Pet pet = unit.GetComponent<Pet>();
|
|
PlayerData data = unit.GetComponent<PlayerData>();
|
|
response.eatCount = data.petEatCount;
|
|
response.active = data.petActive;
|
|
response.petState = (int) pet.petState;
|
|
response.remainTime = (int) (pet.actionEndTime - TimeHelper.ClientNow());
|
|
reply();
|
|
await ETTask.CompletedTask;
|
|
}
|
|
}
|
|
|
|
}
|