Пример #1
0
    /// <summary>
    /// 响应服务器消息释放技能
    /// 如果目前存在指定ID的技能实例, 则停止原来的技能, 释放新的技能.  (完全相信服务器)
    /// </summary>
    /// <param name="skillID"></param>
    private void ReleaseSkillByServerMessage(int skillID, uint targetID, Vector3 offset, int launcherIndex, bool ignorePrediction = false)
    {
        if (IsReleasingSkill(skillID))
        {
            StopSkill(skillID, false);
        }

        if (IsPredict(skillID))
        {
            return;
        }

        SkillBase newSkill = CreateSkill(skillID);

        if (newSkill != null)
        {
            if (m_RemoveSkillList.Contains(skillID))
            {
                m_RemoveSkillList.Remove(skillID);
            }

            m_IDToSkill[skillID] = newSkill;
            m_Property.SetCurrentSkillID(skillID);
        }

        SpacecraftEntity target = m_GameplayProxy.GetEntityById <SpacecraftEntity>(targetID) as SpacecraftEntity;

        m_State = newSkill.ReleaseSkillByServerMessage(targetID, offset, launcherIndex, ignorePrediction);
        m_Property.SetCurrentSkillState(m_State);
    }
Пример #2
0
    /// <summary>
    /// 创建掉落物协议
    /// </summary>
    /// <param name="respond"></param>
    public void CreateDropItemByRespond(s2cSyncPersonalDrop respond)
    {
        if (respond.DropList.Count <= 0)
        {
            /// Debug.Log("CreateDropItemByRespond:the drop_list.Count <= 0");
            return;
        }

        if (respond.IsMapSync == false)
        {
            int index = Random.Range(0, 2);
            WwiseUtil.PlaySound(WwiseManager.voiceComboID, index == 0 ? WwiseMusicSpecialType.SpecialType_Voice_minera_event3 : WwiseMusicSpecialType.SpecialType_Voice_minera_event4, WwiseMusicPalce.Palce_1st, false, null);
        }

        ulong parentid = 0;

        foreach (var item in respond.DropList)
        {
            string key = item.MapId.ToString() + item.AreaUid.ToString() + item.ChestNpcUid.ToString();
            if (!m_GatherDropItemInfos.ContainsKey(key))
            {
                MineDropItemInfo mineDropItemInfo = new MineDropItemInfo();
                mineDropItemInfo.mapid     = item.MapId;
                mineDropItemInfo.areaid    = item.AreaUid;
                mineDropItemInfo.uid       = item.ChestNpcUid;
                mineDropItemInfo.tid       = item.ChestNpcTid;
                mineDropItemInfo.item_tid  = item.DropItemTid;
                mineDropItemInfo.ship_tlv  = item.ShipTlv;
                mineDropItemInfo.parentid  = item.FromHeroUid;
                mineDropItemInfo.positon_x = item.PositonX;
                mineDropItemInfo.positon_y = item.PositonY;
                mineDropItemInfo.positon_z = item.PositonZ;
                if (parentid == 0)
                {
                    parentid = mineDropItemInfo.parentid;
                }

                uint  mapId  = m_CfgEternityProxy.GetCurrentMapData().GamingmapId;
                ulong aredId = m_GameplayProxy.GetCurrentAreaUid();

                if (mapId == item.MapId && aredId == item.AreaUid)
                {
                    CreateDropItem(key, mineDropItemInfo, respond.IsMapSync == false);
                }
            }
        }

        /// 新掉落播音效
        if (respond.IsDieDrop == false && respond.IsMapSync == false && parentid != 0)
        {
            SpacecraftEntity spacecraftEntity = m_GameplayProxy.GetEntityById <SpacecraftEntity>((uint)parentid);
            spacecraftEntity.SendEvent(ComponentEventName.PlayDropSound, null);
        }
    }
Пример #3
0
    protected override void Update()
    {
        GameplayProxy    gameplayProxy = Facade.RetrieveProxy(ProxyName.GameplayProxy) as GameplayProxy;
        SpacecraftEntity entity        = gameplayProxy.GetEntityById <SpacecraftEntity>((uint)m_AIUid);

        if (entity == null || entity.transform == null)
        {
            UIManager.Instance.ClosePanel(this);
            return;
        }

        bool isInScreen = IsInScreen(entity.transform.position, Camera.main);

        //忽略屏幕外的
        if (isInScreen)
        {
            //屏幕内显示图标
            Vector3 screenPoint = Camera.main.WorldToScreenPoint(entity.transform.position);
            Vector2 localPoint  = Vector2.zero;
            if (RectTransformUtility.ScreenPointToLocalPointInRectangle(m_Root, screenPoint, m_Camera, out localPoint))
            {
                m_Icon.gameObject.SetActive(true);
                m_Icon.anchoredPosition = localPoint;
                //m_Animation.anchoredPosition = localPoint;
                //m_Icon.localScale = Vector3.one;
                //m_Animation.localScale = Vector3.one;
            }
        }
        else
        {
            m_Icon.gameObject.SetActive(false);
        }
    }
Пример #4
0
    public Buff(BuffVO vo, IBuffProperty property)
    {
        VO           = vo;
        BuffProperty = property;

        // Cache
        m_SkillProxy    = GameFacade.Instance.RetrieveProxy(ProxyName.CfgSkillSystemProxy) as CfgSkillSystemProxy;
        m_GameplayProxy = GameFacade.Instance.RetrieveProxy(ProxyName.GameplayProxy) as GameplayProxy;

        Leyoutech.Utility.DebugUtility.LogWarning("Buff", string.Format("创建一个Buff ---> 归属entity = {0} , Buff ID = {1}", BuffProperty.EntityId(), VO.ID));

        SkillBuff configVO = m_SkillProxy.GetBuff((int)VO.ID);

        if (configVO.ByteBuffer != null)
        {
            BuffEffect = BuffEffectBase.GetBuffEffectByType((BuffEffectType)configVO.BuffEffectId, this);
            Transform        selfTf      = BuffProperty.GetRootTransform();
            SpacecraftEntity otherEntity = m_GameplayProxy.GetEntityById <SpacecraftEntity>(VO.Link_id) as SpacecraftEntity;
            Transform        otherTf     = null;
            if (otherEntity != null && !otherEntity.IsDead())
            {
                otherTf = otherEntity.GetRootTransform();
            }

            BuffEffect.Init(selfTf, otherTf);
        }
        else
        {
            BuffEffect = new BuffEffectBase(this);
        }
    }
Пример #5
0
    /// <summary>
    /// 更新准星的位置
    /// </summary>
    protected override void Update()
    {
        RaycastTarget_OLD();

        m_Root.gameObject.SetActive(!IsWatchOrUIInputMode() && !IsDead() && !IsLeaping());

        if (m_Crosshair == null)
            return;

        if (m_WeaponStyle == WeaponAndCrossSight.WeaponAndCrossSightTypes.Null)
		{
			if (m_CurrentTarget != null)
			{
				GameplayProxy sceneProxy = Facade.RetrieveProxy(ProxyName.GameplayProxy) as GameplayProxy;
				SpacecraftEntity main = sceneProxy.GetEntityById<SpacecraftEntity>(sceneProxy.GetMainPlayerUID());

				m_CurrentTarget = null;
				m_RaycastProxy.SetCurrentTarget(null);
				main.SetTarget(null, null);
			}
			return;
		}

        UpdateCrossHairPosition();
        UpdateWeaponBullets();
        UpdateWeaponCrosshairOffset();
        UpdateTargetList();
        UpdateShotPoint();

		//RaycastTarget_OLD();
    }
Пример #6
0
    /// <summary>
    /// 状态改变
    /// </summary>
    private void OnStateChanged()
    {
        GameplayProxy    proxy  = Facade.RetrieveProxy(ProxyName.GameplayProxy) as GameplayProxy;
        SpacecraftEntity entity = proxy.GetEntityById <SpacecraftEntity>(proxy.GetMainPlayerUID());

        if (entity != null)
        {
            //Debug.LogError(entity.GetCurrentState().IsHasSubState(EnumSubState.LeapPrepare)+", "+ entity.GetCurrentState().IsHasSubState(EnumSubState.Leaping)+", "+ entity.GetCurrentState().IsHasSubState(EnumSubState.LeapCancel));
            if (entity.GetCurrentState().IsHasSubState(EnumSubState.LeapPrepare))
            {
                OnLeapStart(proxy.GetLeapTargetAreaUid());
                SetLeapState(LEAP_PHASE.READY);
            }
            else if (entity.GetCurrentState().IsHasSubState(EnumSubState.Leaping))
            {
                SetLeapState(LEAP_PHASE.LEAP);
            }
            else
            {
                SetLeapState(LEAP_PHASE.NORMAL);
            }
        }
        else
        {
            SetLeapState(LEAP_PHASE.NORMAL);
        }
    }
Пример #7
0
    private uint GetRoleLevel()
    {
        GameplayProxy gameplayProxy = GameFacade.Instance.RetrieveProxy(ProxyName.GameplayProxy) as GameplayProxy;
        BaseEntity    mainPlayer    = gameplayProxy.GetEntityById <BaseEntity>(gameplayProxy.GetMainPlayerUID());

        return(mainPlayer?.GetLevel() ?? 1);
    }
Пример #8
0
    /// <summary>
    /// 是否可以取消跃迁
    /// </summary>
    /// <returns></returns>
    private bool IsCanCancelLeap()
    {
        GameplayProxy    gameplayProxy = GameFacade.Instance.RetrieveProxy(ProxyName.GameplayProxy) as GameplayProxy;
        SpacecraftEntity entity        = gameplayProxy.GetEntityById <SpacecraftEntity>(gameplayProxy.GetMainPlayerUID());

        return(!entity.GetCurrentState().IsHasSubState(EnumSubState.LeapCancel));
    }
Пример #9
0
        /// <summary>
        /// 弹夹信息,只有主角才有
        /// </summary>
        /// <param name="result"></param>
        private static void DisposeSyncClipInfo(SyncClipInfo result)
        {
            //Leyoutech.Utility.DebugUtility.LogWarning("广播", string.Format("弹夹信息, 武器ID = {0}", result.CurWeaponUid));
            GameplayProxy    m_GameplayProxy = GameFacade.Instance.RetrieveProxy(ProxyName.GameplayProxy) as GameplayProxy;
            SpacecraftEntity entity          = m_GameplayProxy.GetEntityById <SpacecraftEntity>(m_GameplayProxy.GetMainPlayerUID());

            if (entity == null)
            {
                return;
            }

            PlayerSkillProxy m_PlayerSkillProxy = GameFacade.Instance.RetrieveProxy(ProxyName.PlayerSkillProxy) as PlayerSkillProxy;

            m_PlayerSkillProxy.ChangeCurrentWeaponByServer(result.CurWeaponUid);

            foreach (WeaponValue info in result.Infos)
            {
                ulong weaponUID = info.WeaponUid;

                WeaponPowerVO power = entity.GetWeaponPower(weaponUID);
                if (power == null)
                {
                    entity.SetWeaponPower(weaponUID, new WeaponPowerVO());
                    power = entity.GetWeaponPower(weaponUID);
                }

                power.WeaponUID    = info.WeaponUid;
                power.CurrentValue = info.CurValue;
                power.MaxValue     = info.MaxValue;
                power.SafeValue    = info.SaftyValue;

                IWeapon weapon = m_PlayerSkillProxy.GetWeaponByUID(power.WeaponUID);
                if (weapon != null && weapon.GetConfig().ClipType != (int)WeaponL1.Treasure)
                {
                    if (power.CurrentValue <= 0)
                    {
                        power.ForceCooldown = true;
                    }
                    else if (power.CurrentValue >= power.SafeValue)
                    {
                        power.ForceCooldown = false;
                    }
                }
                else
                {
                    if (power.CurrentValue >= power.MaxValue)
                    {
                        power.ForceCooldown = true;
                    }
                    else if (power.CurrentValue <= power.SafeValue)
                    {
                        power.ForceCooldown = false;
                    }
                }
            }

            GameFacade.Instance.SendNotification(NotificationName.MSG_CHARACTER_WEAPON_POWER_CHANGED);
            entity.SendEvent(ComponentEventName.WeaponPowerChanged, null);
        }
Пример #10
0
    public WeaponPowerVO GetCurrentWeaponPowerOfMainPlayer()
    {
        GameplayProxy    gameplayProxy = GameFacade.Instance.RetrieveProxy(ProxyName.GameplayProxy) as GameplayProxy;
        SpacecraftEntity mainEntity    = gameplayProxy.GetEntityById <SpacecraftEntity>(gameplayProxy.GetMainPlayerUID());
        IWeapon          curWeapon     = GetCurrentWeapon();

        return(curWeapon != null?mainEntity.GetWeaponPower(curWeapon.GetUID()) : null);
    }
Пример #11
0
    protected override void Update()
    {
        if (!m_Content)
        {
            return;
        }
        if (!m_Content.gameObject.activeSelf)
        {
            return;
        }

        GameplayProxy proxy = Facade.RetrieveProxy(ProxyName.GameplayProxy) as GameplayProxy;

        SpacecraftEntity main = proxy.GetEntityById <SpacecraftEntity>(proxy.GetMainPlayerUID());

        if (main == null)
        {
            return;
        }

        Transform mainShadow = main.GetSyncTarget();

        if (mainShadow == null)
        {
            return;
        }

        Rigidbody rigidbody = mainShadow.GetComponent <Rigidbody>();

        if (rigidbody == null)
        {
            return;
        }

        SpacecraftMotionComponent mainMotion = main.GetEntityComponent <SpacecraftMotionComponent>();

        if (mainMotion == null)
        {
            return;
        }

        SpacecraftMotionInfo cruiseMotion = mainMotion.GetCruiseModeMotionInfo();

        Vector3 velocity = rigidbody.transform.InverseTransformDirection(rigidbody.velocity);

        float upSpeed        = velocity.y;
        float upSpeedMax     = cruiseMotion.LineVelocityMax.y;
        float upSpeedPercent = Mathf.Clamp01(Mathf.Abs(upSpeed) / Mathf.Abs(upSpeedMax));

        float dir = upSpeedPercent * (upSpeed > 0 ? 1 : -1);

        m_Content.SetBool("Opened", upSpeed != 0);
        m_AltitudeRule.FillAmount  = 0.5f - upSpeedPercent * dir * 0.5f;
        m_AltitudeArrow.FillAmount = 0.5f + upSpeedPercent * dir * 0.5f;

        //Debug.LogError(string.Format("{0:N2}/{1:N2} = {2:N3}", upSpeed, upSpeedMax, upSpeedPercent));
    }
Пример #12
0
    private void OnSkillEffect(IComponentEvent componentEvent)
    {
        S2C_SKILL_EFFECT_Event respond = componentEvent as S2C_SKILL_EFFECT_Event;

        SpacecraftEntity caster  = m_GameplayProxy.GetEntityById <SpacecraftEntity>(respond.msg.wCasterID) as SpacecraftEntity;
        SpacecraftEntity target  = m_GameplayProxy.GetEntityById <SpacecraftEntity>(respond.msg.wTargetHeroID) as SpacecraftEntity;
        Camera           mainCam = CameraManager.GetInstance().GetMainCamereComponent()?.GetCamera();

        if (caster != null && target != null && target.IsMain() && mainCam != null)
        {
            Vector3 targetToAttacker          = caster.GetRootTransform().position - target.GetRootTransform().position;
            AttackWarningDirection warningDir = GetAttackDirection(targetToAttacker);

            Debug.LogFormat("HitWarning | SKillEffect. {0}", warningDir);

            EffectController hitWarningFX = EffectManager.GetInstance().CreateEffect(m_WarningMap[warningDir], EffectManager.GetEffectGroupNameInSpace(true));
            hitWarningFX.transform.SetParent(m_Property.GetSkinRootTransform(), false);
        }
    }
Пример #13
0
    /// <summary>
    /// 是否可以跃迁
    /// </summary>
    /// <returns></returns>
    private bool IsCanLeap()
    {
        GameplayProxy    gameplayProxy = GameFacade.Instance.RetrieveProxy(ProxyName.GameplayProxy) as GameplayProxy;
        SpacecraftEntity entity        = gameplayProxy.GetEntityById <SpacecraftEntity>(gameplayProxy.GetMainPlayerUID());

        return((entity.GetCurrentState().GetMainState() == EnumMainState.Cruise || entity.GetCurrentState().GetMainState() == EnumMainState.Born) &&
               !entity.GetCurrentState().IsHasSubState(EnumSubState.Peerless) &&
               !entity.GetCurrentState().IsHasSubState(EnumSubState.LeapPrepare) &&
               !entity.GetCurrentState().IsHasSubState(EnumSubState.Leaping) &&
               !entity.GetCurrentState().IsHasSubState(EnumSubState.LeapCancel));
    }
Пример #14
0
    /// <summary>
    /// 是否在跃迁中
    /// </summary>
    /// <returns>bool</returns>
    protected bool IsLeaping()
    {
        GameplayProxy    proxy  = Facade.RetrieveProxy(ProxyName.GameplayProxy) as GameplayProxy;
        SpacecraftEntity entity = proxy.GetEntityById <SpacecraftEntity>(proxy.GetMainPlayerUID());

        if (entity)
        {
            return(entity.IsLeap());
        }
        return(false);
    }
Пример #15
0
    public void SyncDiscoverPrecious(S2C_SYNC_PLAYER_DISCOVER_PRECIOUS msg)
    {
        int type = msg.discover_type;

        /// 发现信号 0是飞出
        if (type == (int)PlayerDiscoverPreciousType.DiscoverSignal)
        {
            if (msg.is_in != 0)
            {
                SpacecraftEntity main = m_GameplayProxy.GetEntityById <SpacecraftEntity>(m_GameplayProxy.GetMainPlayerUID());
                m_Effect = EffectManager.GetInstance().CreateEffect(m_CfgEternityProxy.GetGamingConfig(1).Value.Treasure.Value.Effect.Value.DiscoverCameraEffect, EffectManager.GetEffectGroupNameInSpace(true));
                m_Effect.transform.SetParent(main.GetSkinRootTransform(), false);
                m_Effect.SetCreateForMainPlayer(true);

                WwiseUtil.PlaySound((int)WwiseMusic.InTreasure_FX_Sound, false, null);
                WwiseUtil.PlaySound(WwiseManager.voiceComboID, WwiseMusicSpecialType.SpecialType_Voice_treasure_event1, WwiseMusicPalce.Palce_1st, false, null);
                MsgDetectorShow msgDetectorShow = new MsgDetectorShow();
                msgDetectorShow.Show = true;
                GameplayProxy gameplayProxy = Facade.RetrieveProxy(ProxyName.GameplayProxy) as GameplayProxy;
                Vector3       pos           = gameplayProxy.ServerAreaOffsetToClientPosition(new Vector3(0, (float)msg.fY, 0));
                msgDetectorShow.Height    = pos.y;              //todo 宝藏的高度
                msgDetectorShow.MaxHeight = (float)msg.fR * 2f; //触发范围最大高度
                Facade.SendNotification(NotificationName.MSG_DETECTOR_SHOW, msgDetectorShow);
                Facade.SendNotification(NotificationName.MSG_INTERACTIVE_SHOWTIP, HudNpcInteractiveFlagPanel.InteractiveTipType.Precious);
            }
            else
            {
                MsgDetectorShow msgDetectorShow = new MsgDetectorShow();
                msgDetectorShow.Show = false;
                Facade.SendNotification(NotificationName.MSG_DETECTOR_SHOW, msgDetectorShow);
                Facade.SendNotification(NotificationName.MSG_INTERACTIVE_HIDETIP, HudNpcInteractiveFlagPanel.InteractiveTipType.Precious);
            }
        }
        /// 发现宝藏 0是飞出
        else if (msg.is_in != 0 && type == (int)PlayerDiscoverPreciousType.DiscoverPrecious)
        {
            MsgDetectorShow msgDetectorShow = new MsgDetectorShow();
            msgDetectorShow.Show = false;
            // WwiseUtil.PlaySound(WwiseManager.voiceComboID, WwiseMusicSpecialType.SpecialType_Voice_treasure_event2, WwiseMusicPalce.Palce_1st, false, null);
        }
    }
Пример #16
0
    /// <summary>
    /// 设置掉落无信息
    /// </summary>
    public void SetDropItemInfoByDeath(uint heroID, List <DropInfo> drop_list)
    {
        OnSaveDropItemInfo(heroID, drop_list, 2);
        bool             needAddIntera = CheckIsDropItem(heroID);
        GameplayProxy    gameplayProxy = GameFacade.Instance.RetrieveProxy(ProxyName.GameplayProxy) as GameplayProxy;
        SpacecraftEntity spe           = gameplayProxy.GetEntityById <SpacecraftEntity>(heroID) as SpacecraftEntity;

        if (needAddIntera)
        {
            spe.SetDropItemUId(heroID);
            DropItemManager.Instance.CreateDropItemByDeath(heroID, spe);
        }
    }
Пример #17
0
    private void OnWeaponPowerChanged(KProtoBuf buffer)
    {
        S2C_WEAPON_VALUE msg    = buffer as S2C_WEAPON_VALUE;
        SpacecraftEntity entity = m_GameplayProxy.GetEntityById <SpacecraftEntity>(m_GameplayProxy.GetMainPlayerUID());

        if (entity == null)
        {
            return;
        }

        m_PlayerSkillProxy.ChangeCurrentWeaponByServer(msg.cur_weapon_uid);

        foreach (WEAPONVALUE info in msg.infos)
        {
            ulong weaponUID = info.weapon_oid;

            WeaponPowerVO power = entity.GetWeaponPower(weaponUID);
            if (power == null)
            {
                entity.SetWeaponPower(weaponUID, new WeaponPowerVO());
                power = entity.GetWeaponPower(weaponUID);
            }

            power.WeaponUID    = info.weapon_oid;
            power.CurrentValue = info.cur_value;
            power.MaxValue     = info.max_value;
            power.SafeValue    = info.safty_valve;

            IWeapon weapon = m_PlayerSkillProxy.GetWeaponByUID(power.WeaponUID);
            if (weapon != null && weapon.GetConfig().ClipType != (int)WeaponL1.Treasure)
            {
                if (power.CurrentValue <= 0)
                {
                    power.ForceCooldown = true;
                }
                else if (power.CurrentValue >= power.SafeValue)
                {
                    power.ForceCooldown = false;
                }
            }
            else
            {
                if (power.CurrentValue >= power.MaxValue)
                {
                    power.ForceCooldown = true;
                }
                else if (power.CurrentValue <= power.SafeValue)
                {
                    power.ForceCooldown = false;
                }
            }
        }

        GameFacade.Instance.SendNotification(NotificationName.MSG_CHARACTER_WEAPON_POWER_CHANGED);
        entity.SendEvent(ComponentEventName.WeaponPowerChanged, null);
    }
Пример #18
0
    private void LookAtMainPlayerOnInteraction()
    {
        //npc 转向对着人物
        if (m_NpcTmpVO.DialogueTurn == 1)
        {
            GameplayProxy gamePlayProxy = GameFacade.Instance.RetrieveProxy(ProxyName.GameplayProxy) as GameplayProxy;
            HumanEntity   mainPlayer    = gamePlayProxy.GetEntityById <HumanEntity>(gamePlayProxy.GetMainPlayerUID());

            Transform mptf = (mainPlayer != null) ? mainPlayer.GetSkinTransform() : null;

            if (mptf)
            {
                GetSkinTransform().DOLookAt(new Vector3(mptf.position.x, GetSkinTransform().position.y, mptf.position.z), 0.5f).SetAutoKill(true);
            }
        }
    }
Пример #19
0
 private void OnLeap(HotkeyCallback callback)
 {
     if (callback.performed)
     {
         GameplayProxy    proxy  = GameFacade.Instance.RetrieveProxy(ProxyName.GameplayProxy) as GameplayProxy;
         SpacecraftEntity entity = proxy.GetEntityById <SpacecraftEntity>(proxy.GetMainPlayerUID());
         if (entity != null)
         {
             if (!entity.IsLeap())
             {
                 (GameFacade.Instance.RetrieveProxy(ProxyName.AutoNavigationProxy) as AutoNavigationProxy)?
                 .GoTo(m_CfgEternityProxy.GetCurrentGamingMapId(), MapManager.GetInstance().GetCurrentAreaUid(), m_Data.gamingmapId, m_CurrentCell.GetData().areaId);
                 UIManager.Instance.ClosePanel(UIPanel.StarAreaPanel);
             }
         }
     }
 }
Пример #20
0
    /// <summary>
    /// 更新
    /// </summary>
    protected override void Update()
    {
        if (m_MainEntity == null)
        {
            m_MainEntity = m_GameplayProxy.GetEntityById <SpacecraftEntity>(m_GameplayProxy.GetMainPlayerUID());
        }
        ShowChestHint();
        ShowOpenChest();

        bool isShow = m_Content && m_Content.gameObject.activeSelf;

        if (isShow != m_PrevIsShow)
        {
            ResetHotkeys(InputManager.Instance.CurrentInputDevice);
            m_PrevIsShow = isShow;
        }
    }
Пример #21
0
    private void UpdateCrossHairPosition()
    {
        if (!m_IsIn6DofMode)
            return;
        
        GameplayProxy sceneProxy = Facade.RetrieveProxy(ProxyName.GameplayProxy) as GameplayProxy;
        SpacecraftEntity main = sceneProxy.GetEntityById<SpacecraftEntity>(sceneProxy.GetMainPlayerUID());

        Vector3 offset = main.GetMouseOffset();
        float x = Screen.width / 2 + offset.x;
        float y = Screen.height / 2 + offset.y;

        Vector2 point;
        if (RectTransformUtility.ScreenPointToLocalPointInRectangle(m_Root.parent.GetComponent<RectTransform>(), new Vector2(x, y), m_Camera, out point))
        {
            m_Root.anchoredPosition = point;
        }
    }
Пример #22
0
    public override void OnLateUpdate()
    {
        if (m_StartType == DistanceType.none)
        {
            return;
        }

        /// 检测音效范围
        Npc   npcVO  = m_Property.GetNPCTemplateVO();
        float range  = npcVO.TriggerRange;
        float dis    = Vector3.Distance(m_MainEntity.GetRootTransform().position, m_Property.GetRootTransform().position);
        uint  curUID = m_TreasureHuntProxy.GetCurDetectorUID();
        uint  uid    = m_Property.GetUId();

        if (dis > range)
        {
            if (uid == curUID)
            {
                WwiseUtil.PlaySound(m_Sounds[DistanceType.none], false, m_TreasureHuntProxy.GetCurDetectorTransfrom());
                m_TreasureHuntProxy.SetCurDetectorSoundInfo(0, null);
            }
        }
        else
        {
            if (curUID == 0)
            {
                WwiseUtil.PlaySound(m_Sounds[m_StartType], false, m_Property.GetRootTransform());
                m_TreasureHuntProxy.SetCurDetectorSoundInfo(uid, m_Property.GetRootTransform());
            }
            else if (uid != curUID)
            {
                SpacecraftEntity entity = m_GameplayProxy.GetEntityById <SpacecraftEntity>(curUID);
                /// 距离当前正在播的距离
                float curDis = Vector3.Distance(m_MainEntity.GetRootTransform().position, entity.GetRootTransform().position);
                if (dis < curDis)
                {
                    WwiseUtil.PlaySound(m_Sounds[DistanceType.none], false, m_TreasureHuntProxy.GetCurDetectorTransfrom());
                    WwiseUtil.PlaySound(m_Sounds[m_StartType], false, m_Property.GetRootTransform());
                    m_TreasureHuntProxy.SetCurDetectorSoundInfo(uid, m_Property.GetRootTransform());
                }
            }
        }
    }
Пример #23
0
    void Update()
    {
        if (!m_Valid)
        {
            return;
        }

        // 找到主角
        if (m_MainPlayerTransform == null)
        {
            GameplayProxy gameplayProxy = GameFacade.Instance.RetrieveProxy(ProxyName.GameplayProxy) as GameplayProxy;
            uint          uid           = gameplayProxy.GetMainPlayerUID();
            BaseEntity    mainPlayer    = gameplayProxy.GetEntityById <BaseEntity>(uid);
            if (mainPlayer != null)
            {
                m_MainPlayerTransform = mainPlayer.transform;
            }
        }

        if (m_MainPlayerTransform != null)
        {
            // 判断主角是不是进入了光照触发区域
            float distanceFromCenter = (m_MainPlayerTransform.position - transform.position).magnitude;
            m_MainPlayerEntered = distanceFromCenter < m_Collider.radius;

            // 主角进入光照区域, 调节光强
            if (m_MainPlayerEntered)
            {
                float entryDistance = m_Collider.radius - distanceFromCenter;
                m_IntensityPercent = 0f;
                if (entryDistance > 0)
                {
                    m_IntensityPercent = Mathf.Clamp01(entryDistance / BlendDistance);
                }

                m_Light.intensity = m_InitialIntensity * m_IntensityPercent;
            }
            else
            {
                Reset();
            }
        }
    }
Пример #24
0
    private void ShowRelivePanel(DeadEvent deadEvent)
    {
        //if (m_SpacecraftDeadProperty.IsMain())
        //{
        //    string killerName = "error_name";
        //    if (deadEvent.KillerNpctemplateID > 0)
        //    {
        //        killerName = TableUtil.GetNpcName(deadEvent.KillerNpctemplateID);
        //    }
        //    else
        //    {
        //        killerName = deadEvent.KillerPlayerName;
        //    }

        //    bool isShowHallRelive = false;
        //    foreach (var item in deadEvent.ReliveOptions)
        //    {
        //        if (item == (short)PlayerReliveType.relive_hall)
        //        {
        //            isShowHallRelive = true;
        //            break;
        //        }
        //    }

        //    GameFacade.Instance.SendNotification(NotificationName.MainHeroDeath, new ShowRelviePanelNotify()
        //    {
        //        IsShowHallRelive = isShowHallRelive,
        //        Countdown = deadEvent.CD,
        //        KillerName = killerName,
        //    });
        //}

        SpacecraftEntity mainPlayer = m_GameplayProxy.GetMainPlayer();

        if (mainPlayer.GetTarget() == m_GameplayProxy.GetEntityById <SpacecraftEntity>(m_SpacecraftDeadProperty.GetUId()))
        {
            mainPlayer.SetTarget(null, null);
        }
    }
Пример #25
0
 /// <summary>
 /// 更新
 /// </summary>
 protected override void Update()
 {
     if (m_MainEntity == null)
     {
         m_MainEntity = m_GameplayProxy.GetEntityById <SpacecraftEntity>(m_GameplayProxy.GetMainPlayerUID());
     }
     if (!IsWatchOrUIInputMode() && !IsLeaping())
     {
         if (Time.frameCount % 5 == 0 && m_Show)
         {
             if (!m_Content.gameObject.activeSelf)
             {
                 WwiseUtil.PlaySound((int)WwiseMusic.Music_Hud_Resource_Open, false, null);
                 m_Content.gameObject.SetActive(true);
             }
             CalculateHeight();
         }
     }
     else
     {
         if (m_Content.gameObject.activeSelf)
         {
             WwiseUtil.PlaySound((int)WwiseMusic.Music_Hud_Resource_Close, false, null);
             m_Content.gameObject.SetActive(false);
         }
     }
     if (IsDead())
     {
         m_Show = false;
         if (m_Content.gameObject.activeSelf)
         {
             WwiseUtil.PlaySound((int)WwiseMusic.Music_Hud_Resource_Close, false, null);
             m_Content.gameObject.SetActive(false);
         }
     }
 }
Пример #26
0
    public bool CanCurrentWeaponRelease()
    {
        SpacecraftEntity mainEntity = m_GameplayProxy.GetEntityById <SpacecraftEntity>(m_GameplayProxy.GetMainPlayerUID());

        if (mainEntity.GetCurrentState().GetMainState() != EnumMainState.Fight || mainEntity.GetCurrSkillId() > 0) //非战斗状态 || 有技能在释放中
        {
            return(false);
        }


        if (UsingReformer())
        {
            return(true);
        }

        IWeapon curWeapon = GetCurrentWeapon();

        if (curWeapon == null)
        {
            return(false);
        }

        return(CanWeaponRelease(curWeapon.GetUID()));
    }
Пример #27
0
    /// <summary>
    /// 更新视图
    /// </summary>
    protected override void Update()
    {
        if (!IsDead() && !IsWatchOrUIInputMode() && !IsLeaping())
        {
            //GameplayProxy sceneProxy = Facade.RetrieveProxy(ProxyName.GameplayProxy) as GameplayProxy;
            //SpacecraftEntity main = sceneProxy.GetEntityById<SpacecraftEntity>(sceneProxy.GetMainPlayerUID());
            if (m_MainEntity == null)
            {
                m_MainEntity = m_GameplayProxy.GetEntityById <SpacecraftEntity>(m_GameplayProxy.GetMainPlayerUID());
            }
            if (!m_MainEntity)
            {
                return;
            }
            List <SpacecraftEntity> entitys = m_GameplayProxy.GetEntities <SpacecraftEntity>();

            //按距离排序
            entitys.Sort((a, b) =>
            {
                Vector3 distanceA = a.transform.position - m_MainEntity.transform.position;
                Vector3 distanceB = b.transform.position - m_MainEntity.transform.position;
                return((int)(distanceB.sqrMagnitude - distanceA.sqrMagnitude));
            });

            bool isInSpace = IsInSpace();
            for (int i = 0; i < entitys.Count; i++)
            {
                SpacecraftEntity entity             = entitys[i];
                KHeroType        heroType           = entity.GetHeroType();
                Vector3          titleOffset        = Vector3.zero;
                float            visibilityDistance = GameConstant.DEFAULT_VISIBILITY_METRE_FOR_SHIP;

                //忽略自已
                // if (entity == main)
                //    continue;

                //忽略不需要显示的NPC
                if (heroType != KHeroType.htPlayer)
                {
                    Npc entityVO = m_CfgEternityProxy.GetNpcByKey(entity.GetTemplateID());
                    if (entityVO.Display == 0)
                    {
                        continue;
                    }

                    if (entityVO.HeroHeaderLength >= 3)
                    {
                        titleOffset = new Vector3(entityVO.HeroHeader(0), entityVO.HeroHeader(1), entityVO.HeroHeader(2));
                    }

                    visibilityDistance = entityVO.MissionTargetHiddenDistance * (isInSpace ? GameConstant.METRE_PER_UNIT : 1);
                }

                //忽略死亡的( 除了矿石 )
                if (heroType != KHeroType.htMine && heroType != KHeroType.htPreicous && (entity.GetAttribute(AttributeName.kHP) <= 0 || entity.GetCurrentState().GetMainState() == EnumMainState.Dead))
                {
                    continue;
                }
                if (entity.m_EntityFatherOwnerID > 0 && heroType == KHeroType.htMine)
                {
                    continue;
                }
                //忽略不支持的
                RectTransform template = GetTemplate(m_MainEntity, entity);
                if (!template)
                {
                    continue;
                }

                //忽略过远的
                float distance = (entity.transform.position - m_MainEntity.transform.position).magnitude;
                if (entity.GetHeroType() == KHeroType.htMine && distance > entity.GetNPCTemplateVO().TriggerRange)
                {
                    continue;
                }
                distance = distance * GameConstant.METRE_PER_UNIT;
                if (distance >= visibilityDistance)
                {
                    continue;
                }

                //忽略屏幕外的
                Vector3 screenPosition = Camera.main.WorldToScreenPoint(entity.transform.TransformPoint(titleOffset));
                if (!(screenPosition.z > Camera.main.nearClipPlane && screenPosition.x >= 0 && screenPosition.x <= Camera.main.pixelWidth && screenPosition.y > 0 && screenPosition.y <= Camera.main.pixelHeight))
                {
                    continue;
                }

                Vector2 anchoredPosition;
                if (RectTransformUtility.ScreenPointToLocalPointInRectangle(m_Root, screenPosition, m_Camera, out anchoredPosition))
                {
                    Transform templatePool = m_TemplateToPool[template];

                    uint uid   = entity.GetUId();
                    bool isNew = false;

                    EntityView info;
                    if (m_UIDToRectTranform1.ContainsKey(uid))
                    {
                        info = m_UIDToRectTranform1[uid];
                        m_UIDToRectTranform1.Remove(uid);
                        m_UIDToRectTranform2[uid] = info;
                    }
                    else
                    {
                        RectTransform view = templatePool.childCount > 0 ? templatePool.GetChild(0).GetComponent <RectTransform>() : Object.Instantiate(template, m_Root);
                        view.SetParent(m_Root);
                        view.transform.SetAsLastSibling();
                        view.gameObject.SetActive(true);

                        info = new EntityView()
                        {
                            uid = uid, view = view, viewPool = templatePool
                        };
                        m_UIDToRectTranform2[uid] = info;
                        isNew = true;


                        OnTargetCreate(entity, view);
                    }

                    OnTargetUpdate(m_MainEntity, entity, info.view, anchoredPosition, distance, visibilityDistance, m_MouseMoved, isNew);
                }
            }
        }

        m_MouseMoved = false;

        //回收无效的
        foreach (EntityView info in m_UIDToRectTranform1.Values)
        {
            info.view.SetParent(info.viewPool);
        }
        m_UIDToRectTranform1.Clear();

        Dictionary <uint, EntityView> tmp = m_UIDToRectTranform1;

        m_UIDToRectTranform1 = m_UIDToRectTranform2;
        m_UIDToRectTranform2 = tmp;
    }
Пример #28
0
    /// <summary>
    /// 更新UI
    /// </summary>
    private void UpdateUI()
    {
        if (m_NearestTarget)
        {
            m_NearestTarget.GetSkinRootTransform();

            float hp    = (float)m_NearestTarget.GetAttribute(AttributeName.kHP);
            float hpMax = (float)m_NearestTarget.GetAttribute(AttributeName.kHPMax);

            float hpProgress = hpMax <= 0 ? 0 : hp / hpMax;
            //int phase = Mathf.Min(4, Mathf.FloorToInt(hpProgress / (1.0f / 5)));

            m_HpBar.fillAmount = hpProgress;
            m_HpBarLabel.text  = Mathf.FloorToInt(hpProgress * 100) + "%";
            m_HpBarState.text  = "";           // GetLocalization("hud_text_id_" + (1021 + phase));

            if (m_TargetViewer && m_TargetViewer.Camera && m_TargetViewer.ModelArray != null)
            {
                if (m_TargetList.Count > 0)
                {
                    for (int i = 0; i < m_TargetViewer.ModelArray.Length; i++)
                    {
                        SpacecraftEntity entity = m_GameplayProxy.GetEntityById <SpacecraftEntity>(m_TargetList[i]);
                        if (entity != null)
                        {
                            Transform skinTransform = entity.GetSkinTransform();
                            if (skinTransform != null)
                            {
                                for (int k = 0; k < m_TargetViewer.ModelArray[i].transform.childCount; k++)
                                {
                                    Transform child = m_TargetViewer.ModelArray[i].transform;
                                    if (child.GetChild(k).GetComponent <EffectController>() != null)
                                    {
                                        continue;
                                    }
                                    string name = child.GetChild(k).name;
                                    if (skinTransform.Find(name) == null)
                                    {
                                        child.GetChild(k).gameObject.SetActive(false);
                                    }
                                    else
                                    {
                                        child.GetChild(k).gameObject.SetActive(true);
                                    }
                                }
                            }
                        }
                        else
                        {
                            GameObject currentModel = m_TargetViewer.ModelArray[i];
                            for (int j = 0; j < currentModel.transform.childCount; j++)
                            {
                                if (currentModel.transform.GetChild(j).GetComponent <EffectController>() != null)
                                {
                                    continue;
                                }
                                currentModel.transform.GetChild(j).gameObject.SetActive(false);
                            }
                        }
                    }
                }
                Transform skin = m_NearestTarget.GetSkinTransform();
                if (skin)
                {
                    Camera           mainCamera = CameraManager.GetInstance().GetMainCamereComponent().GetCamera();
                    GameplayProxy    sceneProxy = Facade.RetrieveProxy(ProxyName.GameplayProxy) as GameplayProxy;
                    SpacecraftEntity mainHero   = sceneProxy.GetEntityById <SpacecraftEntity>(sceneProxy.GetMainPlayerUID());

                    float   bestDistance  = m_TargetViewer.ModelBoundsDiagonalLength / 2.0f / Mathf.Tan(mainCamera.fieldOfView * Mathf.Deg2Rad / 2.0f);
                    Vector3 bestDirection = mainCamera.transform.position - mainHero.transform.position;

                    m_TargetViewer.ModelBox.rotation         = skin.rotation;
                    m_TargetViewer.Camera.transform.position = m_TargetViewer.ModelBox.position + bestDirection.normalized * bestDistance;
                    m_TargetViewer.Camera.transform.LookAt(m_TargetViewer.ModelBox);
                }
            }

            if (m_TargetViewer.EffectArray != null)
            {
                foreach (EffectController effect in m_TargetViewer.EffectArray)
                {
                    VFXController effectObject = effect.GetEffectObject();
                    if (effectObject)
                    {
                        Animator animator = effectObject.GetComponent <Animator>();
                        if (animator)
                        {
                            animator.SetFloat("Color", 1 - hpProgress);
                        }
                    }
                }
            }
        }
        else
        {
            m_HpBarState.text = GetLocalization("hud_text_id_" + 1021);
        }
    }
Пример #29
0
    /// <summary>
    /// 每帧更新
    /// </summary>
    protected override void Update()
    {
        if (!m_TargetViewer)
        {
            return;
        }

        bool needShow  = !IsWatchOrUIInputMode() && !IsDead() && !IsLeaping();
        bool hasTarget = false;

        if (m_MainSpacecraftEntity == null)
        {
            m_MainSpacecraftEntity = m_GameplayProxy.GetEntityById <SpacecraftEntity>(m_GameplayProxy.GetMainPlayerUID());
        }
        SpacecraftEntity target = m_NearestTarget;

        //每隔5帧重新查找一下最近矿物
        if (m_NearestTargetCounter % 5 == 0)
        {
            target = FindNearestTarget();
        }
        m_NearestTargetCounter++;

        if (target && target.GetAttribute(AttributeName.kHP) <= 0)
        {
            target = null;
        }

        //加载模型
        LoadViewerModel(target);
        if (target)
        {
            int bloodVolumeLength = m_CfgEternityProxy.GetDoppingBloodVolumeLengthByKey((uint)target.GetTemplateID()) - 1;
            if (m_OldPrivew != bloodVolumeLength)
            {
                m_OldPrivew = bloodVolumeLength;
                while (m_LineGrid.childCount - 2 < bloodVolumeLength)
                {
                    Transform lineItem = Object.Instantiate(m_LineGrid.GetChild(1), m_LineGrid);
                    lineItem.gameObject.SetActive(true);
                }
                for (int i = bloodVolumeLength + 2; i < m_LineGrid.childCount; i++)
                {
                    m_LineGrid.GetChild(i).gameObject.SetActive(false);
                }
            }
        }
        //更新UI
        m_Root.SetBool("Show", needShow && target != null);
        UpdateUI();

        if (needShow && target != null && m_IsPlayShowMusic == 0)
        {
            m_IsPlayShowMusic = 1;
            m_IsPlayHideMusic = 0;
            WwiseUtil.PlaySound((int)WwiseMusic.Music_Hud_Resource_Open, false, null);
        }
        if (m_IsPlayShowMusic == 1 && !(needShow && target != null) && m_IsPlayHideMusic == 0)
        {
            m_IsPlayHideMusic = 1;
            m_IsPlayShowMusic = 0;
            WwiseUtil.PlaySound((int)WwiseMusic.Music_Hud_Resource_Close, false, null);
        }

        //更新全息效果的透明度
        if (needShow)
        {
            UpdateCurrentTarget();
            hasTarget = m_CurrentTarget != null;
        }
        m_TargetImage.alpha = needShow && hasTarget ? 1.0f : 0.1f;

        //提示玩家切换到战斗模式
        if (needShow && !IsBattling() && m_CurrentTarget != null)
        {
            if (!m_IsShow)
            {
                m_IsShow = true;
                m_IsHide = false;
                Facade.SendNotification(NotificationName.MSG_INTERACTIVE_SHOWTIP, HudNpcInteractiveFlagPanel.InteractiveTipType.Collector);
            }
        }
        else
        {
            if (!m_IsHide)
            {
                m_IsHide = true;
                m_IsShow = false;
                Facade.SendNotification(NotificationName.MSG_INTERACTIVE_HIDETIP, HudNpcInteractiveFlagPanel.InteractiveTipType.Collector);
            }
        }
    }
Пример #30
0
    /// <summary>
    /// 更新
    /// </summary>
    protected override void Update()
    {
        CfgEternityProxy  eternityProxy     = Facade.RetrieveProxy(ProxyName.CfgEternityProxy) as CfgEternityProxy;
        TaskTrackingProxy taskTrackingProxy = Facade.RetrieveProxy(ProxyName.TaskTrackingProxy) as TaskTrackingProxy;

        if (!IsWatchOrUIInputMode() && !IsDead() && !IsLeaping())
        {
            GameplayProxy gamePlayProxy = Facade.RetrieveProxy(ProxyName.GameplayProxy) as GameplayProxy;
            BaseEntity    main          = gamePlayProxy.GetEntityById <BaseEntity>(gamePlayProxy.GetMainPlayerUID());

            List <SpacecraftEntity> humanList = gamePlayProxy.GetEntities <SpacecraftEntity>(KHeroType.htNpc);
            foreach (SpacecraftEntity entity in humanList)
            {
                if (entity.GetHeroType() != KHeroType.htNpc)
                {
                    continue;
                }

                Npc entityVO = eternityProxy.GetNpcByKey(entity.GetTemplateID());
                if (entityVO.Display == 0)
                {
                    continue;
                }

                Vector3 titleOffset    = entityVO.HeroHeaderLength >= 3 ? new Vector3(entityVO.HeroHeader(0), entityVO.HeroHeader(1), entityVO.HeroHeader(2)) : Vector3.zero;
                Vector3 targetPosition = entity.transform.position + entity.transform.TransformDirection(titleOffset);

                //屏幕外忽略
                if (!IsInScreen(targetPosition, Camera.main))
                {
                    continue;
                }

                //太远忽略
                float targetDistance = Vector3.Distance(entity.transform.position, main.transform.position) * GameConstant.METRE_PER_UNIT;
                if (targetDistance >= entityVO.MissionTargetHiddenDistance * GameConstant.METRE_PER_UNIT)
                {
                    continue;
                }

                Vector2 iconPosition;
                Vector3 screenPosition = Camera.main.WorldToScreenPoint(targetPosition);
                if (RectTransformUtility.ScreenPointToLocalPointInRectangle(m_FlagBox, screenPosition, m_CanvasCamera, out iconPosition))
                {
                    bool isNew    = false;
                    uint entityID = entity.GetUId();

                    //创建标记
                    RectTransform flag = m_NpcID2FlagA.ContainsKey(entityID) ? m_NpcID2FlagA[entityID] : null;
                    if (flag == null)
                    {
                        if (m_IdleBox.childCount > 0)
                        {
                            flag = m_IdleBox.GetChild(0).GetComponent <RectTransform>();
                            flag.gameObject.SetActive(true);
                            flag.SetParent(m_FlagBox);
                        }
                        else
                        {
                            flag = Object.Instantiate(m_FlagTemplate, m_FlagBox);
                            flag.gameObject.SetActive(true);
                        }
                        isNew = true;
                    }
                    m_NpcID2FlagA.Remove(entityID);
                    m_NpcID2FlagB.Add(entityID, flag);

                    //标记坐标
                    flag.anchoredPosition = new Vector2(iconPosition.x, iconPosition.y);

                    //名称文本
                    if (isNew)
                    {
                        flag.Find("Name/Label_NPCName").GetComponent <TMP_Text>().text = TableUtil.GetNpcName(entity.GetTemplateID());

                        Image npcIcon = flag.Find("IconBox/IconScenceNameElement/Image_NpcIcon").GetComponent <Image>();
                        npcIcon.color = entityVO.NameBoardIcon == 0 ? Color.clear : Color.white;
                        if (entityVO.NameBoardIcon != 0)
                        {
                            UIUtil.SetIconImage(npcIcon, entityVO.NameBoardIcon);
                        }
                    }

                    //任务
                    TaskTrackingProxy.TrackingInfo tracking = taskTrackingProxy.GetNpcMission(entity.GetUId(), entity.GetTemplateID());
                    MissionType missionType = tracking != null ? tracking.MissionType : MissionType.None;

                    //任务状态
                    RectTransform flagIcon            = FindComponent <RectTransform>(flag, "IconBox");
                    RectTransform flagMission         = FindComponent <RectTransform>(flag, "MissionBox");
                    Animator      flagMissionAnimator = FindComponent <Animator>(flagMission, "IconMissionElement");
                    Image         flagMissionIcon     = FindComponent <Image>(flagMissionAnimator, "Icon").GetComponent <Image>();

                    UIUtil.SetIconImage(flagMissionIcon, GameConstant.FUNCTION_ICON_ATLAS_ASSETADDRESS, GetMissionIcon(missionType));

                    flagMission.gameObject.SetActive(missionType != MissionType.None);
                    flagIcon.gameObject.SetActive(!flagMission.gameObject.activeSelf);
                    taskTrackingProxy.SetAreadyAddMissionInfo(entity.GetUId(), entity.GetTemplateID());

                    flagMissionAnimator.SetBool("Finished", tracking != null && tracking.MissionState == MissionState.Finished);

                    /*
                     * //图标动画
                     * Animator flagIconAnimator = flag.Find("IconBox").GetComponent<Animator>();
                     * if (flagIconAnimator != null && flagIconAnimator.runtimeAnimatorController != null && flagIconAnimator.isActiveAndEnabled)
                     * {
                     *  flagIconAnimator.ResetTrigger("Open");
                     *  flagIconAnimator.ResetTrigger("Close");
                     *  flagIconAnimator.SetTrigger(targetDistance <= GameConstant.DEFAULT_HUMAN_TITLE_SHOW_RANGE * 2 ? "Open" : "Close");
                     * }
                     *
                     * //名称动画
                     * Animator flagTextAnimator = flag.Find("Name").GetComponent<Animator>();
                     * if (flagTextAnimator != null && flagTextAnimator.runtimeAnimatorController != null && flagTextAnimator.isActiveAndEnabled)
                     * {
                     *  flagTextAnimator.ResetTrigger("Open");
                     *  flagTextAnimator.ResetTrigger("Close");
                     *  flagTextAnimator.SetTrigger(targetDistance <= GameConstant.DEFAULT_HUMAN_TITLE_SHOW_RANGE ? "Open" : "Close");
                     * }
                     */
                }
            }
        }

        //回收标记
        foreach (var flag in m_NpcID2FlagA)
        {
            taskTrackingProxy.SetAreadyAddMissionInfo(flag.Key, 0, true);
            flag.Value.gameObject.SetActive(false);
            flag.Value.SetParent(m_IdleBox);
        }
        m_NpcID2FlagA.Clear();

        //交换缓存
        Dictionary <uint, RectTransform> tmp = m_NpcID2FlagA;

        m_NpcID2FlagA = m_NpcID2FlagB;
        m_NpcID2FlagB = tmp;
    }