// ------------------------------------------------------------------ // 逃跑. void Run() { // 如果有抓目標就丟下目標. for (int i = 0; i < pCarry.Length; i++) { if (pCarry[i]) { pCarry[i].ReleaseWarriors(); } } // 播放逃跑動作. pAI.AniPlay("Escape"); // 抓人旗標關閉. pAI.bHasTarget = false; // 取得走路方向. if (vecRunDir == Vector3.zero) { GetDir(); } // 調整面向前進. pAI.FaceAndMove(vecRunDir, 3.5f); if (EnemyCreater.pthis.CheckPos(gameObject)) { Destroy(gameObject); } }
// ------------------------------------------------------------------ // 逃跑. void Run() { // 如果有抓目標就丟下目標. if (pAI.bHasTarget) { pAI.bHasTarget = false; if (ObjTarget && ObjTarget.GetComponent <AIPlayer>()) { ObjTarget.GetComponent <AIPlayer>().BeFree(); } } // 播放逃跑動作. pAI.AniPlay("Escape"); if (vecRunDir == Vector3.zero) { GetDir(); } // 調整面向前進. pAI.FaceAndMove(vecRunDir, 3.5f); if (EnemyCreater.pthis.CheckPos(gameObject)) { Destroy(gameObject); } }
// ------------------------------------------------------------------ // 逃跑. void Run() { // 播放逃跑動作. pAI.AniPlay("Escape"); // 調整面向但不前進. pAI.FaceAndMove(transform.position - CameraCtrl.pthis.GetMyObj().transform.position, 4); if (EnemyCreater.pthis.CheckPos(gameObject)) { Destroy(gameObject); } }