Exemplo n.º 1
0
        public override void OnUpdate()
        {
            UpdateCoolDownGameItems();

            base.OnUpdate();
            if (Time.frameCount % 5 != 0)
            {
                return;
            }
            BuildingAtkWarningManager.Instance.OnUpdate();
            //SecondaryGuideManager.Instance.OnUpdate();
            IGuideMidMatchTip.Instance.OnUpdate();
            //if (UIEnemyTeamMateInfo.Instance != null)
            //{
            //    UIEnemyTeamMateInfo.Instance.OnUpdate();
            //}

            if (this.FSM != null && this.FSM.State == FsmState.FSM_STATE_DEAD)
            {
                return;
            }
            if (SyncLockTarget != null && SyncLockTarget.realObject != null)
            {
                if (Vector3.Distance(this.objTransform.position, SyncLockTarget.objTransform.position) > GameConstDefine.PlayerLockTargetDis)
                {
                    if (!PlayerManager.Instance.IsLocalSameType(SyncLockTarget) && SyncLockTarget.entityType == EntityType.Monster || SyncLockTarget.entityType == EntityType.Soldier)
                    {
                        if (SyncLockTarget.XueTiao != null)
                        {
                            SyncLockTarget.XueTiao.IsXueTiaoCpVib(false);
                        }
                    }
                    this.SetSyncLockTarget(null);
                }
                return;
            }
            if (AutoLockTarget)
            {
                IEnumerable <Ientity> ItemList = GameMethod.GetEnemyItemListByRadius(PlayerManager.Instance.LocalPlayer, GameConstDefine.PlayerLockTargetDis);
                IEnumerator <Ientity> Item     = ItemList.GetEnumerator();
                Item.MoveNext();
                if (ItemList == null || Item.Current == null)
                {
                    return;
                }
                this.SetSyncLockTarget(Item.Current);
            }
        }
        private void CheckAddHeroBornVoice()
        {
            if (heroVoicDic != null && heroVoicDic.Count == 3)
            {
                return;
            }
            IEnumerable <Ientity> Items    = GameMethod.GetEnemyItemListByRadius(PlayerManager.Instance.LocalPlayer, GameConstDefine.PlayerLockTargetDis);
            List <Ientity>        ItemList = Items.ToList();

            if (ItemList == null || ItemList.Count == 0)
            {
                return;
            }
            for (int i = ItemList.Count - 1; i >= 0; i--)
            {
                Ientity entity = ItemList[i];
                if (SceneGuideTaskManager.Instance().IsFakeHero(entity.NpcGUIDType))
                {
                    AddHeroVoice(entity.NpcGUIDType);
                }
            }
        }