/// <summary> /// 在武器变化的时候, 更新当前实装的武器的准星信息 /// </summary> private void UpdateBattleWeapons(IComponentEvent entityEvent) { PlayerSkillProxy m_SkillProxy = GameFacade.Instance.RetrieveProxy(ProxyName.PlayerSkillProxy) as PlayerSkillProxy; for (int iWeapon = 0; iWeapon < BATTLE_WEAPON_COUNT; iWeapon++) { IWeapon weapon = m_SkillProxy.GetWeaponByIndex(iWeapon); if (weapon == null) { continue; } ulong uid = weapon.GetUID(); if (!m_IPerceptronTarget.HaveWeaponAndCrossSight(uid)) { WeaponAndCrossSight weaponAndCross = WeaponAndCrossSightFactory.CreatTWeapon(uid, weapon.GetConfig().Id, weapon.GetBaseConfig().SkillId, (WeaponAndCrossSight.WeaponAndCrossSightTypes)weapon.GetConfig().Reticle); //Debug.LogError(string.Format("创建准星 uid = {0}, tid = {1} , type = {2}, null? {3}", uid, weapon.GetConfig().Id, weapon.GetConfig().Reticle , (weaponAndCross== null))); if (weaponAndCross == null) { continue; } m_IPerceptronTarget.AddWeaponAndCrossSight(uid, weaponAndCross); } } }
/// <summary> /// 转化炉切换 /// </summary> /// <param name="entityEvent"></param> private void ReformerWeapons(IComponentEvent entityEvent) { if (m_IPerceptronTarget.GetCurrentState().IsHasSubState(EnumSubState.Peerless)) { //转化炉模式 if (!m_SkillProxy.UsingReformer()) { return; } IReformer reformer = m_SkillProxy.GetReformer(); if (reformer == null) { return; } ulong uid = reformer.GetUID(); if (!m_IPerceptronTarget.HaveWeaponAndCrossSight(uid)) { WeaponAndCrossSight weaponAndCross = WeaponAndCrossSightFactory.CreatTWeapon(uid, reformer.GetConfig().Id, reformer.GetBaseConfig().SkillId, (WeaponAndCrossSight.WeaponAndCrossSightTypes)reformer.GetConfig().Reticle); //Debug.LogError(string.Format("创建准星 uid = {0}, tid = {1} , type = {2}, null? {3}", uid, weapon.GetConfig().Id, weapon.GetConfig().Reticle , (weaponAndCross== null))); if (weaponAndCross == null) { return; } m_IPerceptronTarget.AddWeaponAndCrossSight(uid, weaponAndCross); } } else { //非转化炉模式 m_IPerceptronTarget.DeleReformerWeaponAndCrossSight(); } }