private void SetTarget(Transform t) { // Change targets color if (target) { target.GetComponent <TargetModel>().SetCurrentTarget(false); } t.GetComponent <TargetModel>().SetCurrentTarget(true); // Update target target = t; robot.SetD(t); // Update info in commands CommandsDropdown_IndexChanged(commandsDropdown.value); }