public void SetNextGoal() { if (goal_index >= ordered_goals.Count - 1) { goal_index = 0; } else { goal_index += 1; } goal_script.setGoal(ordered_goals[goal_index]); Debug.Log(ordered_goals[goal_index].ToString()); }
// Use this for initialization void Start() { goal_script = GetComponent <PathGoal>(); goal_script.setGoal(ordered_goals[goal_index]); }