Ejemplo n.º 1
0
    protected override void UpdateState()
    {
        if (GetOwnerType() == 1)
        {
            ObjectHero obj = (ObjectHero)SceneObjectManager.GetInstance().GetSceneObjectByGameObject(this.gameObject);
            if (obj != null)
            {
                CurState = obj.GetActionState();
                if (obj.GetCurLockTarget() != null)
                {
                    CurLockTarget = obj.GetCurLockTarget().GetGameObject();
                }
                if (obj.GetSkillLockTarget() != null)
                {
                    CurLockSkillTarget = obj.GetSkillLockTarget().GetGameObject();
                }
            }
        }
        else
        {
            ObjectMonster obj = (ObjectMonster)SceneObjectManager.GetInstance().GetSceneObjectByGameObject(this.gameObject);
            if (obj != null)
            {
                CurState = obj.GetActionState();
            }
        }

        if (m_EventData != null && _anim[lastAnimatimName] != null)
        {
            m_EventData.OnUpdateEvent(_event, _anim[lastAnimatimName]);
        }
    }
Ejemplo n.º 2
0
        private void OnAiTagLogic1()
        {
            if (m_ReleaseObj.GetGroupType() == EM_OBJECT_TYPE.EM_OBJECT_TYPE_HERO)
            {
                int        count = SceneObjectManager.GetInstance().GetObjectMonsterCount();
                ObjectHero hero  = (ObjectHero)m_ReleaseObj;
                //选择相克目标
//                 switch(hero.GetHeroRow().getCamp())
//                 {
//                     case (int)EM_HERO_CAMP_TYPE.EM_HERO_CAMP_TYPE1:
//                         for (int i = 0; i < count;++i)
//                         {
//                             if (SceneObjectManager.GetInstance().GetSceneMonsterList()[i].GetMonsterRow().getCamp() == (int)EM_HERO_CAMP_TYPE.EM_HERO_CAMP_TYPE2)
//                             {
//                                 m_SkillTag = SceneObjectManager.GetInstance().GetSceneMonsterList()[i];
//                                 return;
//                             }
//                         }
//                             break;
//                     case (int)EM_HERO_CAMP_TYPE.EM_HERO_CAMP_TYPE2:
//                             for (int i = 0; i < count; ++i)
//                             {
//                                 if (SceneObjectManager.GetInstance().GetSceneMonsterList()[i].GetMonsterRow().getCamp() == (int)EM_HERO_CAMP_TYPE.EM_HERO_CAMP_TYPE3)
//                                 {
//                                     m_SkillTag = SceneObjectManager.GetInstance().GetSceneMonsterList()[i];
//                                     return;
//                                 }
//                             }
//                             break;
//                     case (int)EM_HERO_CAMP_TYPE.EM_HERO_CAMP_TYPE3:
//                             for (int i = 0; i < count; ++i)
//                             {
//                                 if (SceneObjectManager.GetInstance().GetSceneMonsterList()[i].GetMonsterRow().getCamp() == (int)EM_HERO_CAMP_TYPE.EM_HERO_CAMP_TYPE1)
//                                 {
//                                     m_SkillTag = SceneObjectManager.GetInstance().GetSceneMonsterList()[i];
//                                     return;
//                                 }
//                             }
//                             break;
//                 }
                //选择普通攻击目标
                if (m_SkillTag == null || m_SkillTag.IsAlive() == false)
                {
                    m_SkillTag = hero.GetCurLockTarget();
                }
            }
            else if (m_ReleaseObj.GetGroupType() == EM_OBJECT_TYPE.EM_OBJECT_TYPE_MONSTER)
            {
                int           count   = SceneObjectManager.GetInstance().GetObjectHeroCount();
                ObjectMonster monster = (ObjectMonster)m_ReleaseObj;
                //选择相克目标
//                 switch (monster.GetMonsterRow().getCamp())
//                 {
//                     case (int)EM_HERO_CAMP_TYPE.EM_HERO_CAMP_TYPE1:
//                         for (int i = 0; i < count; ++i)
//                         {
//                             if (SceneObjectManager.GetInstance().GetSceneHeroList()[i].GetHeroRow().getCamp() == (int)EM_HERO_CAMP_TYPE.EM_HERO_CAMP_TYPE2)
//                             {
//                                 m_SkillTag = SceneObjectManager.GetInstance().GetSceneHeroList()[i];
//                                 return;
//                             }
//                         }
//                         break;
//                     case (int)EM_HERO_CAMP_TYPE.EM_HERO_CAMP_TYPE2:
//                         for (int i = 0; i < count; ++i)
//                         {
//                             if (SceneObjectManager.GetInstance().GetSceneHeroList()[i].GetHeroRow().getCamp() == (int)EM_HERO_CAMP_TYPE.EM_HERO_CAMP_TYPE3)
//                             {
//                                 m_SkillTag = SceneObjectManager.GetInstance().GetSceneHeroList()[i];
//                                 return;
//                             }
//                         }
//                         break;
//                     case (int)EM_HERO_CAMP_TYPE.EM_HERO_CAMP_TYPE3:
//                         for (int i = 0; i < count; ++i)
//                         {
//                             if (SceneObjectManager.GetInstance().GetSceneHeroList()[i].GetHeroRow().getCamp() == (int)EM_HERO_CAMP_TYPE.EM_HERO_CAMP_TYPE1)
//                             {
//                                 m_SkillTag = SceneObjectManager.GetInstance().GetSceneHeroList()[i];
//                                 return;
//                             }
//                         }
//                         break;
//                 }
                //选择普通攻击目标
                if (m_SkillTag == null || m_SkillTag.IsAlive() == false)
                {
                    m_SkillTag = monster.GetCurLockTarget();
                }
            }
        }