private bool goOn(PathWaypoint target, bool success) { if (!target.onGoalReached(success)) { this.currentTarget++; if (this.currentTarget >= this.waypoints.Count) { if (this.shouldLoopNextTime()) { this.currentTarget = 0; } else { this.currentTarget = -1; return(false); } } } return(true); }
public Path(EntityPathable entity, PathWaypoint goal, bool doesLoop, bool continueTryingWhenFailed) : this(entity, new[] { goal }, doesLoop, continueTryingWhenFailed) { }