Ejemplo n.º 1
0
        private void LoadPartsConfig()
        {
            TextAsset partsConfigData = Resources.Load(ANTURA_REWARDS_PARTS_CONFIG_PATH) as TextAsset;

            partsConfig = JsonUtility.FromJson <RewardPartsConfig>(partsConfigData.text);
            BuildAllPacks(partsConfig);
        }
Ejemplo n.º 2
0
        void BuildAllPacks(RewardPartsConfig partsConfig)
        {
            rewardPacksDict.Clear();
            rewardPacksDict[RewardBaseType.Prop]    = BuildPacks(partsConfig, RewardBaseType.Prop);
            rewardPacksDict[RewardBaseType.Texture] = BuildPacks(partsConfig, RewardBaseType.Texture);
            rewardPacksDict[RewardBaseType.Decal]   = BuildPacks(partsConfig, RewardBaseType.Decal);

            if (VERBOSE)
            {
                Debug.Log("Total packs built: "
                          + "\n " + RewardBaseType.Prop + ": " + +rewardPacksDict[RewardBaseType.Prop].Count
                          + "\n " + RewardBaseType.Texture + ": " + +rewardPacksDict[RewardBaseType.Texture].Count
                          + "\n " + RewardBaseType.Decal + ": " + +rewardPacksDict[RewardBaseType.Decal].Count
                          );
            }
        }
Ejemplo n.º 3
0
        private List <RewardPack> BuildPacks(RewardPartsConfig partsConfig, RewardBaseType baseType)
        {
            var bases  = partsConfig.GetBasesForType(baseType);
            var colors = partsConfig.GetColorsForType(baseType);

            if (VERBOSE)
            {
                Debug.Log("Building packs for " + baseType
                          + "\n Bases: " + bases.Count() + " Colors: " + colors.Count());
            }

            List <RewardPack> rewardPacks = new List <RewardPack>();

            foreach (var b in bases)
            {
                foreach (var c in colors)
                {
                    RewardPack pack = new RewardPack(baseType, b, c);
                    rewardPacks.Add(pack);
                }
            }
            return(rewardPacks);
        }