/// <summary> /// 服务器蓄力索引结果 /// </summary> /// <param name="obj"></param> public void OnAccumulationIndexResult(IComponentEvent obj) { AccumulationIndexResult result = obj as AccumulationIndexResult; if (result == null) { return; } if (result.skillId != SkillID) { return; } SkillData skillData = m_Context.GetObject <SkillData>(); string lpc = string.Empty; if (skillData.ReleaseStageData.Value.IsDynamicLoopCount) { m_RunningData.ReleaseLoopCount = m_ISpacecraftSkillProperty.GetPerceptronTarget().GetCurrentTargetsCount(); lpc = string.Format("动态loopcout = {0}", m_RunningData.ReleaseLoopCount); } Leyoutech.Utility.DebugUtility.Log("蓄力", " 蓄力结果 index = " + result.accumulationIndex + lpc); m_RunningData.ReleaseStageIndex = result.accumulationIndex; StageType = SkillStageType.Release; }
/// <summary> /// 处理蓄力抬起 /// </summary> private void DisposeAccumulationSkillEndResult(uint entityId, AccumulationSkillEndResult result) { if (result == null) { Leyoutech.Utility.DebugUtility.LogError("蓄力抬起", "服务器下行消息 --- >AccumulationSkillEndResult 为null ,服务器检查下 "); return; } BaseEntity entity = GameplayManager.Instance.GetEntityManager().GetEntityById <BaseEntity>(entityId); if (entity == null) { return; } if (result.Code) { //成功 AccumulationIndexResult accResult = new AccumulationIndexResult(); accResult.skillId = (int)result.SkillId; accResult.accumulationIndex = (int)result.GroupIndex; entity.SendEvent(ComponentEventName.AccumulationIndex, accResult); } else { //失败 EndSkillResult endResult = new EndSkillResult(); uint skillid = result.SkillId; endResult.skillId = (int)skillid; entity.SendEvent(ComponentEventName.ToEndSkill, endResult); } }
/// <summary> /// 广播蓄力索引,目标列表等 /// </summary> private void BroadCastSkillAccumulation(IComponentEvent entityEvent) { BroadCastSkill_Accumulation bctarges = entityEvent as BroadCastSkill_Accumulation; m_PerceptronTarget.SetBroadCastTargets(bctarges.targets, bctarges.direction, true); //成功 AccumulationIndexResult accResult = new AccumulationIndexResult(); accResult.skillId = (int)bctarges.skillId; accResult.accumulationIndex = (int)bctarges.groupIndex; SendEvent(ComponentEventName.AccumulationIndex, accResult); }