Ejemplo n.º 1
0
 public static void DownloadQuestMaps(QuestParam quest)
 {
     for (int index1 = 0; index1 < quest.map.Count; ++index1)
     {
         if (!string.IsNullOrEmpty(quest.map[index1].mapSetName))
         {
             string src = AssetManager.LoadTextData(AssetPath.LocalMap(quest.map[index1].mapSetName));
             if (src != null)
             {
                 JSON_MapUnit jsonObject = JSONParser.parseJSONObject <JSON_MapUnit>(src);
                 if ((int)jsonObject.is_rand > 0)
                 {
                     if (jsonObject.deck != null)
                     {
                         for (int index2 = 0; index2 < jsonObject.deck.Length; ++index2)
                         {
                             DownloadUtility.DownloadUnit(new NPCSetting(jsonObject.deck[index2]));
                         }
                     }
                 }
                 else if (jsonObject.enemy != null)
                 {
                     for (int index2 = 0; index2 < jsonObject.enemy.Length; ++index2)
                     {
                         DownloadUtility.DownloadUnit(new NPCSetting(jsonObject.enemy[index2]));
                     }
                 }
             }
         }
     }
 }
Ejemplo n.º 2
0
 public static void DownloadQuestBase(QuestParam q)
 {
     if (q.map.Count > 0)
     {
         string mapSceneName = q.map[0].mapSceneName;
         string mapSetName   = q.map[0].mapSetName;
         if (!string.IsNullOrEmpty(mapSceneName))
         {
             AssetManager.PrepareAssets(mapSceneName);
             AssetManager.PrepareAssets(AssetPath.LocalMap(mapSceneName));
         }
         if (!string.IsNullOrEmpty(mapSetName))
         {
             AssetManager.PrepareAssets(AssetPath.LocalMap(mapSetName));
         }
     }
     if (!string.IsNullOrEmpty(q.storyTextID))
     {
         AssetManager.PrepareAssets(LocalizedText.GetResourcePath(q.storyTextID));
     }
     if (!string.IsNullOrEmpty(q.navigation))
     {
         AssetManager.PrepareAssets(AssetPath.Navigation(q));
     }
     if (!string.IsNullOrEmpty(q.event_start))
     {
         AssetManager.PrepareAssets(AssetPath.QuestEvent(q.event_start));
     }
     if (q.map != null)
     {
         for (int index = 0; index < q.map.Count; ++index)
         {
             if (!string.IsNullOrEmpty(q.map[index].eventSceneName))
             {
                 AssetManager.PrepareAssets(AssetPath.QuestEvent(q.map[index].eventSceneName));
             }
         }
     }
     if (string.IsNullOrEmpty(q.event_clear))
     {
         return;
     }
     AssetManager.PrepareAssets(AssetPath.QuestEvent(q.event_clear));
 }