21 lines
669 B
C#
21 lines
669 B
C#
|
using System;
|
|||
|
|
|||
|
namespace ET
|
|||
|
{
|
|||
|
[ActorMessageHandler]
|
|||
|
public class C2M_ChangeItemPosHandler : AMActorLocationRpcHandler<Unit, C2M_ChangeItemPos, M2C_ChangeItemPos>
|
|||
|
{
|
|||
|
protected override async ETTask Run(Unit unit, C2M_ChangeItemPos request, M2C_ChangeItemPos response, Action reply)
|
|||
|
{
|
|||
|
Bag bag = unit.GetComponent<Bag>();
|
|||
|
var retStr = bag.ChangePos(request.Pos1, request.Pos2);
|
|||
|
if (retStr == "")
|
|||
|
{
|
|||
|
BagHelper.GetBagInfo(unit, response.BagMapList);
|
|||
|
}
|
|||
|
response.Message = retStr;
|
|||
|
reply();
|
|||
|
await ETTask.CompletedTask;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|