Esempio n. 1
0
        public MonsterObject(uint _id, int nAi_Id, short x, short y, bool isCreateTypeId = true)
        {
            mTarget      = null;
            id           = _id;
            type         = OBJECTTYPE.MONSTER;
            attr         = new GameStruct.MonterAttribute();
            mRebirthTime = 1000; //默认复活时间
            if (isCreateTypeId)
            {
                typeid = IDManager.CreateTypeId(type);
            }
            mInitPoint   = new GameStruct.Point();
            mInitPoint.x = x;
            mInitPoint.y = y;
            m_Ai         = CreateAi(nAi_Id);

            mnDieMagicTick = System.Environment.TickCount;
            mDieMagicInfo  = null;
            attr.life      = attr.life_max = 0;
            mAliveTime     = new GameBase.Core.TimeOut();
            mAliveTime.SetInterval(mRebirthTime);

            this.SetPoint(x, y);
            // ai = new AI.BaseAI(this);
            Alive();
        }
Esempio n. 2
0
        public MonsterObject(uint _id,int nAi_Id,short x,short y,bool isCreateTypeId = true)
        {
            mTarget = null;
            id = _id;
            type = OBJECTTYPE.MONSTER;
            attr = new GameStruct.MonterAttribute();
            mRebirthTime = 1000; //默认复活时间
            if (isCreateTypeId)
            {
                typeid = IDManager.CreateTypeId(type);
            }
            mInitPoint = new GameStruct.Point();
            mInitPoint.x = x;
            mInitPoint.y = y;
            m_Ai = CreateAi(nAi_Id);

            mnDieMagicTick = System.Environment.TickCount;
            mDieMagicInfo = null;
            attr.life = attr.life_max = 0;
            mAliveTime = new GameBase.Core.TimeOut();
            mAliveTime.SetInterval(mRebirthTime);

            this.SetPoint(x, y);
               // ai = new AI.BaseAI(this);
            Alive();
        }
Esempio n. 3
0
        public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
        {
            if (ai == null)
            {
                ai = animator.GetComponent <AI.BaseAI>();
            }

            ai.isForceToLookPlayer = true;
        }
Esempio n. 4
0
 public AI.BaseAI CreateAi(int nAi_Id)
 {
     AI.BaseAI Ai = null;
     switch (nAi_Id)
     {
     case Define.AI_TYPE_MELEE:
     case Define.AI_TYPE_MELEEEX:
     {
         Ai = new AI.BaseAI();
         break;
     }
     }
     if (Ai == null)
     {
         Ai = new AI.BaseAI();
     }
     Ai.Init(this, nAi_Id);
     return(Ai);
 }
Esempio n. 5
0
 public void SetAi(AI.BaseAI _ai)
 {
     m_Ai = _ai;
 }
Esempio n. 6
0
 public void SetAi(AI.BaseAI _ai)
 {
     m_Ai = _ai;
 }
Esempio n. 7
0
        public AI.BaseAI CreateAi(int nAi_Id)
        {
            AI.BaseAI Ai = null;
            switch (nAi_Id)
            {
                case Define.AI_TYPE_MELEE:
                case Define.AI_TYPE_MELEEEX:
                    {
                        Ai = new AI.BaseAI();
                        break;
                    }

            }
            if (Ai == null)
            {
                Ai = new AI.BaseAI();
            }
            Ai.Init(this, nAi_Id);
            return Ai;
        }