Exemple #1
0
        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]);
                }
            }
        }
Exemple #2
0
        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);
        }