using System; namespace ET { [ActorMessageHandler] public class C2M_GetTaskHandler : AMActorLocationRpcHandler { protected override async ETTask Run(Unit unit, C2M_GetTask request, M2C_GetTask response, Action reply) { UnitTask unitTask = unit.GetComponent(); foreach (var item in unitTask.RunningTaskList) { TansferTask tansferTask = new TansferTask(); tansferTask.Id = (int)item.Id; if (item.CurrAmountList!=null) tansferTask.CurrCompleteList.AddRange(item.CurrAmountList); response.TaskList.Add(tansferTask); } reply(); await ETTask.CompletedTask; } } }