private void PatrolBehaviour() { Vector3 pos = Vector3.zero; _mover.SetSpeed(_patrolSpeed); if (_path != null) { if (AtWaypoint()) { _timeSinceLastPatrolled = 0; _pathIndex = _path.GetJ(_pathIndex); } if (_timeSinceLastPatrolled - _dwellingTime >= Mathf.Epsilon) { pos = _path.GetWaypoint(_pathIndex); } } else { pos = _guardLocation.value; } _mover.MoveToLocation(pos); }
private void GuardBehaviour() { Vector3 nextPosition = this.guardPosition; if (patrolPath != null) { if (AtWaypoint()) { CycleWaypoint(); this.timeEnemyWaited = 0; } nextPosition = patrolPath.GetWaypoint(currentWaypointIndex); } if (this.timeEnemyWaited > this.waypointWaitTime) { this.move.StartMoveAction(nextPosition); } }
private Vector3 GetCurrentWaypoint() { return(patrolPath.GetWaypoint(currentWaypointIndex)); }
private Vector3 GetCurrentWaypoint() //Fragt in PatrolPath.cs nach wo sich der aktuell anzusteuernde Wegpunkt befindet (Position) { return(patrolPath.GetWaypoint(currentWaypointIndex)); }
private Vector3 GetCurrentWaypoint() => patrolPath.GetWaypoint(_currentWaypointIndex);
private Vector3 GetCurrentWaypoint() { Vector3 waypoint = patrolPath.GetWaypoint(currentWaypointIndex); return(waypoint); }