Beispiel #1
0
        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);
        }
Beispiel #2
0
        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);
            }
        }
Beispiel #3
0
 private Vector3 GetCurrentWaypoint()
 {
     return(patrolPath.GetWaypoint(currentWaypointIndex));
 }
Beispiel #4
0
 private Vector3 GetCurrentWaypoint() //Fragt in PatrolPath.cs nach wo sich der aktuell anzusteuernde Wegpunkt befindet (Position)
 {
     return(patrolPath.GetWaypoint(currentWaypointIndex));
 }
Beispiel #5
0
 private Vector3 GetCurrentWaypoint() => patrolPath.GetWaypoint(_currentWaypointIndex);
        private Vector3 GetCurrentWaypoint()
        {
            Vector3 waypoint = patrolPath.GetWaypoint(currentWaypointIndex);

            return(waypoint);
        }