private void SetWaypoint(int index) { _currentWaypointIndex = index; _movementBehaviour.SetDestination(_player.position + _relativeWaypoints[_currentWaypointIndex], AiSettings.WALK_SPEED); _currentWaypointSetDistance = Vector3.Distance(_owner.position, _player.position + _relativeWaypoints[_currentWaypointIndex]); GizmosHelper.DrawSphere(_player.position + _relativeWaypoints[_currentWaypointIndex], 1f, Color.green, 5f); }
public override Type Tick() { _movementBehaviour.SetDestination(_player.position, AiSettings.RUN_SPEED); if (_visionSensor.IsPlayerInCatchDistance()) { return(typeof(CatchState)); } if (Time.time - _stateEnterTime > 7f) { return(typeof(StrafeState)); } return(GetType()); }