public void GoToPlayerLocation() { curDirection = UpdateDirection(); agent.SetDestination(CreatureManager.instance.playerLocation.position); ActivateHeightVariation(); agent.autoBraking = true; }
private IEnumerator WaitForDestination(PathArray path, creatureMode mode) { curDirection = UpdateDirection(); ActivateHeightVariation(); yield return(new WaitForSeconds(2f)); yield return(new WaitUntil(() => NearToTarget() && agent.remainingDistance > 0)); if (mode == creatureMode.random) { GoOnRandomPath(path); } else { nextPathIndex++; GoOnSpecificPath(path); } yield return(null); }