private void Awake() { ParentChain = transform.parent.GetComponent <WaypointChain>(); if (NextWaypoint == null) { isEndpoint = true; } }
public void OnModeChanged() { if (NavMode == Modes.Patrol) { if (TargetChain == null) { TargetChain = FindNearestWaypoint(); } TargetChain.PopulateAgentsList(); PatrolWaypoints(TargetChain); } if (NavMode == Modes.Stand) { StandInPlace(); } }
void PatrolWaypoints(WaypointChain wChain) { Agent.SetDestination(wChain.ChainStart.position); }