22 lines
616 B
C#
22 lines
616 B
C#
using System;
|
|
|
|
namespace ET
|
|
{
|
|
[ActorMessageHandler]
|
|
public class C2M_SplitItemHandler : AMActorLocationRpcHandler<Unit, C2M_SplitItem, M2C_SplitItem>
|
|
{
|
|
protected override async ETTask Run(Unit unit, C2M_SplitItem request, M2C_SplitItem response, Action reply)
|
|
{
|
|
|
|
Bag bag = unit.GetComponent<Bag>();
|
|
string retStr = bag.SplitItem(request.Index, request.Count);
|
|
if (retStr == "")
|
|
{
|
|
BagHelper.GetBagInfo(unit, response.BagMapList);
|
|
}
|
|
response.Message = retStr;
|
|
reply();
|
|
await ETTask.CompletedTask;
|
|
}
|
|
}
|
|
} |