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(); }
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(); }
public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { if (ai == null) { ai = animator.GetComponent <AI.BaseAI>(); } ai.isForceToLookPlayer = true; }
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); }
public void SetAi(AI.BaseAI _ai) { m_Ai = _ai; }
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; }