// Use this for initialization void Start() { if (all_goals.Count > 0) { current_target = all_goals[0]; } }
public void PreviousGoal() { if (current_goal_index == 0 && loop_goals) { current_goal_index = all_goals.Count - 1; } if (current_goal_index - 1 >= 0) { current_goal = all_goals[current_goal_index--]; } }
public void NextGoal() { if (current_goal_index == (all_goals.Count - 1) && loop_goals) { current_goal_index = 0; } if (current_goal_index + 1 < all_goals.Count) { current_goal = all_goals[current_goal_index++]; } }
// Use this for initialization void Start() { if (!current_goal && all_goals.Count > 0) { current_goal = all_goals[0]; } indicator_renderers[0] = throttle_up_indicator.GetComponent <Renderer>(); indicator_renderers[1] = throttle_down_indicator.GetComponent <Renderer>(); indicator_renderers[2] = yaw_CCW_indicator.GetComponent <Renderer>(); indicator_renderers[3] = yaw_CW_indicator.GetComponent <Renderer>(); indicator_renderers[4] = pitch_forward_indicator.GetComponent <Renderer>(); indicator_renderers[5] = pitch_back_indicator.GetComponent <Renderer>(); indicator_renderers[6] = roll_left_indicator.GetComponent <Renderer>(); indicator_renderers[7] = roll_right_indicator.GetComponent <Renderer>(); for (int i = 0; i < indicator_renderers.Length; ++i) { indicator_renderers[i].material.SetColor("_Color", indicator_diffuse[0]); indicator_renderers[i].material.SetColor("_Emissive", indicator_emmisive[0]); } }
public void AddGoal(DroneGoal goal, int index) { all_goals.Insert(index, goal); }