public void ResumeMission() { m_Scenario.Resume(); int[] running_ids = m_Scenario.runningMissionIds; for (int i = 0; i < running_ids.Length; i++) { m_MissionIDs.Add(running_ids[i]); int id = m_MissionIDs[i]; if (!m_MissionProperties.ContainsKey(id)) { MissionProperty mp = new MissionProperty(); mp.Parse(m_Scenario.GetMissionProperties(id), m_Scenario.GetMissionName(id)); m_MissionProperties.Add(id, mp); } if (!m_MissionTrack.ContainsKey(id)) { m_MissionTrack.Add(id, true); } if (onResumeMission != null) { onResumeMission(m_MissionIDs[i]); } } }
public bool RunMission(int id) { if (m_Scenario.RunMission(id)) { m_MissionIDs.Add(id); MissionProperty mp = new MissionProperty(); mp.Parse(m_Scenario.GetMissionProperties(id), m_Scenario.GetMissionName(id)); m_MissionProperties.Add(id, mp); if (!m_MissionTrack.ContainsKey(id)) { m_MissionTrack.Add(id, true); } if (onRunMission != null) { onRunMission(id); } return(true); } else { Debug.LogError("Run mission [" + id + "] failed !"); } return(false); }