24 lines
749 B
C#
Executable File
24 lines
749 B
C#
Executable File
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 =pet.actionEndTime - TimeHelper.ClientNow();
|
|
reply();
|
|
await ETTask.CompletedTask;
|
|
}
|
|
}
|
|
|
|
}
|