using System; using System.Collections.Generic; namespace ET { [ActorMessageHandler] public class C2M_GetAddEnergyPriceHandler : AMActorLocationRpcHandler { protected override async ETTask Run(Unit unit, C2M_GetAddEnergyPrice request, M2C_GetAddEnergyPrice response, Action reply) { PlayerData data = unit.GetComponent(); int count = data.buyEnergyCount; if (count >= ConstDefine.AddEnergyPriceArr.Length) { response.Message = "购买次数达到上限"; reply(); return; } response.Price = ConstDefine.AddEnergyPriceArr[count]; reply(); await ETTask.CompletedTask; } } }