public void goWaitAtkPos(float _dis) { if (deadManager.checkDead) { return; } if (points.CheckFull(_dis)) { cancelSelectTarget(false); return; } //找一個點 tmpPos = points.FindClosePoint(enemyData.atk_Range, myCachedTransform, enemyData.width); if (tmpPos == null && chaseTime > 0) { Debug.Log("找點啦 耖"); return; } else if (tmpPos == null && chaseTime <= 0) { Debug.Log("前往攻擊點這時間到 取消"); cancelSelectTarget(false); return; } points.AddWillGo_P(tmpPos, correctPos); correctPos = tmpPos; lastTmpPos = correctPos.position; resetChaseTime(); nowState = states.AtkMove; getTatgetPoint(correctPos.position); }
public void goAtkPos(CreatPoints _tmpPoint, Transform firstPos, isDead _isdaed) { if (deadManager.checkDead) { return; } if (points != null) { points.RemoveThisPoint(correctPos); } points = _tmpPoint; targetDeadScript = _isdaed; currentTarget = _isdaed.gameObject; //前往找到的點 points.AddWillGo_P(firstPos, correctPos); correctPos = firstPos; lastTmpPos = correctPos.position; resetChaseTime(); //在距離內可直接攻擊 if (IFRightNowAtk()) { return; } nowState = states.AtkMove; getTatgetPoint(correctPos.position); }