Example #1
0
 public void LoadMissionData(MissionData md)
 {
     MissionChangeDelegateDict.Clear();
     MissionItemPosDict.Clear();
     missionData.Reset();
     curMissionData.Reset();
     stepChangeCallback = null;
     //复制两份,一份用来保存原始标准,一份用来记录当前情况
     missionData.MaxSteps = md.MaxSteps;
     foreach (var mp in md.Missions)
     {
         missionData.Missions.Add(mp.Clone());
     }
     foreach (var mp in md.ProtectMissions)
     {
         missionData.ProtectMissions.Add(mp.Clone());
     }
     //
     curMissionData.MaxSteps = md.MaxSteps;
     foreach (var mp in md.Missions)
     {
         var tmp_mp = mp.Clone();
         //当前任务的完成度应该是0,而保护任务的完成度应该是满的
         tmp_mp.Value = 0;
         curMissionData.Missions.Add(tmp_mp);
     }
     foreach (var mp in md.ProtectMissions)
     {
         curMissionData.ProtectMissions.Add(mp.Clone());
     }
     //
     curMissionState = Mission_Processing;
 }