IEnumerator Repair() { MissionManager.Mission myMission = mission; for (int i = 1; i < myMission.blocksFound.Count; i++) { if (myMission.blocksFound[i].states.ContainsKey(State.Damaged)) { Damaged state = myMission.blocksFound[i].states[State.Damaged] as Damaged; if (!state.isBeingRepaired) { state.StartRepair(); break; } } } GameManager.instance.missionManager.EndMission(myMission); yield return(null); }