public void SetDefaultCurPatrolWaypoint() { curPatrolWaypoint = new PatrolWaypoint { position = transform.position, rotation = transform.rotation.eulerAngles, stayTime = 10.0f }; }
public PatrolWaypoint GetNextPatrolWaypoint(bool loop = true) { if (patrolWaypoints == null) { return(curPatrolWaypoint); } int newIndex; if (loop) { newIndex = destinationCount % patrolWaypoints.Count; } else { newIndex = Utils.PingPong(destinationCount, patrolWaypoints.Count - 1); } destinationCount++; curPatrolWaypoint = patrolWaypoints[newIndex]; return(curPatrolWaypoint); }