Beispiel #1
0
 public static void ReleaseTheme(DungeonThemeType theme)
 {
     if (ThemeLoaded(theme))
     {
         s_decosPerThemePerCategory.Remove(theme);
         s_loadedThemes.Remove(theme);
     }
 }
Beispiel #2
0
        public static string GetFogIdForTheme(DungeonThemeType theme)
        {
            switch (theme)
            {
            case DungeonThemeType.Theme001:
                return("Prefabs/Dungeon/CryptFog");

            case DungeonThemeType.Theme003:
                return("Prefabs/Dungeon/WinterSea");
            }
            return(null);
        }
Beispiel #3
0
 public void loadTheme(DungeonThemeType theme)
 {
     if (!this.themeLoaded(theme))
     {
         UnityEngine.Object[] objArray = ResourceUtil.LoadResourcesAtPath(ConfigDungeons.DUNGEON_BLOCKS_RESOURCE_PATH + "/" + theme);
         for (int i = 0; i < objArray.Length; i++)
         {
             object[] objArray1 = new object[] { ConfigDungeons.DUNGEON_BLOCKS_RESOURCE_PATH, "/", theme, "/", objArray[i].name };
             string   key       = string.Concat(objArray1);
             if (!this.m_dungeonBlocksObjs.ContainsKey(key))
             {
                 this.m_dungeonBlocksObjs.Add(key, ((GameObject)ResourceUtil.LoadSafe(key, false)).GetComponent <DungeonBlock>());
             }
         }
         this.m_loadedThemes.Add(theme);
     }
 }
Beispiel #4
0
 public void releaseTheme(DungeonThemeType theme)
 {
     if (this.themeLoaded(theme))
     {
         List <string> list = new List <string>();
         foreach (KeyValuePair <string, DungeonBlock> pair in this.m_dungeonBlocksObjs)
         {
             string   key       = pair.Key;
             object[] objArray1 = new object[] { ConfigDungeons.DUNGEON_BLOCKS_RESOURCE_PATH, "/", theme, "/" };
             if (key.StartsWith(string.Concat(objArray1)))
             {
                 list.Add(key);
             }
         }
         for (int i = 0; i < list.Count; i++)
         {
             this.m_dungeonBlocksObjs.Remove(list[i]);
         }
         this.m_loadedThemes.Remove(theme);
     }
 }
Beispiel #5
0
 public static void LoadTheme(DungeonThemeType theme)
 {
     if (!ThemeLoaded(theme))
     {
         Dictionary <DungeonDecoCategoryType, List <string> > dictionary = new Dictionary <DungeonDecoCategoryType, List <string> >(new DungeonDecoCategoryTypeBoxAvoidanceComparer());
         s_decosPerThemePerCategory.Add(theme, dictionary);
         for (int i = 0; i < ConfigDungeons.DUNGEON_DECO_CATEGORY_TYPES.Count; i++)
         {
             DungeonDecoCategoryType key = ConfigDungeons.DUNGEON_DECO_CATEGORY_TYPES[i];
             dictionary.Add(key, new List <string>());
             UnityEngine.Object[] objArray = ResourceUtil.LoadResourcesAtPath(string.Concat(new object[] { ConfigDungeons.DUNGEON_DECO_RESOURCE_PATH, "/", theme, "/", key }));
             for (int j = 0; j < objArray.Length; j++)
             {
                 string   name      = objArray[j].name;
                 object[] objArray2 = new object[] { ConfigDungeons.DUNGEON_DECO_RESOURCE_PATH, "/", theme, "/", key, "/", name };
                 s_decosPerThemePerCategory[theme][key].Add(string.Concat(objArray2));
             }
         }
         s_loadedThemes.Add(theme);
     }
 }
Beispiel #6
0
 public static bool ParallaxCloudsEnabledForTheme(DungeonThemeType theme)
 {
     return(string.IsNullOrEmpty(GetFogIdForTheme(theme)));
 }
 public List <CharacterType> getMinionCharacterTypes(DungeonThemeType dungeonThemeType)
 {
     return(this.m_dungeonThemeMinionCharacterTypes[dungeonThemeType]);
 }
Beispiel #8
0
 public bool themeLoaded(DungeonThemeType theme)
 {
     return(this.m_loadedThemes.Contains(theme));
 }
        public string getRandomCharacterId(DamageType damageType, GameLogic.CharacterType characterType, DungeonThemeType fallbackDungeonThemeType)
        {
            Dictionary <GameLogic.CharacterType, List <string> > dictionary = (damageType != DamageType.Melee) ? this.m_rangedCharacterIds : this.m_meleeCharacterIds;
            List <string> list = null;

            if (dictionary.ContainsKey(characterType))
            {
                list = dictionary[characterType];
            }
            else
            {
                List <GameLogic.CharacterType> list2 = GameLogic.Binder.DungeonResources.getMinionCharacterTypes(fallbackDungeonThemeType);
                for (int i = 0; i < list2.Count; i++)
                {
                    GameLogic.CharacterType key = list2[i];
                    if (dictionary.ContainsKey(key))
                    {
                        list = dictionary[key];
                        break;
                    }
                }
            }
            return((list != null) ? LangUtil.GetRandomValueFromList <string>(list) : null);
        }
Beispiel #10
0
 public static bool ThemeLoaded(DungeonThemeType theme)
 {
     return(s_loadedThemes.Contains(theme));
 }
Beispiel #11
0
 public static string GetRandomDeco(DungeonThemeType theme, DungeonDecoCategoryType decoCategory)
 {
     return(LangUtil.GetRandomValueFromList <string>(s_decosPerThemePerCategory[theme][decoCategory]));
 }