Exemplo n.º 1
0
        private List <RandomColors> GetColorListForRace(RaceData rc)
        {
            UMATextRecipe utr = rc.baseRaceRecipe as UMATextRecipe;

            UMAPackedRecipeBase.UMAPackRecipe upr = utr.PackedLoad();

            List <string> cols = new List <string>();

            foreach (UMAPackedRecipeBase.PackedOverlayColorDataV3 pcd in upr.fColors)
            {
                if (pcd.name.Trim() != "-")
                {
                    cols.Add(pcd.name);
                }
            }

            List <RandomColors> newColors = new List <RandomColors>();

            foreach (string s in cols)
            {
                RandomColors rcs = new RandomColors(s, null);
                newColors.Add(rcs);
            }
            return(newColors);
        }
Exemplo n.º 2
0
        public RandomWardrobeSlot(UMAWardrobeRecipe slot, string slotName)
        {
#if UNITY_EDITOR
            GuiFoldout = true;
            Delete     = false;
            _slotName  = slotName;
            if (slot == null)
            {
                PossibleColors = new string[0];
            }
            else
            {
                UMAPackedRecipeBase.UMAPackRecipe upr = slot.PackedLoad();

                List <string> cols = new List <string>();
                foreach (UMAPackedRecipeBase.PackedOverlayColorDataV3 pcd in upr.fColors)
                {
                    if (pcd.name.Trim() != "-")
                    {
                        cols.Add(pcd.name);
                    }
                }
                PossibleColors = cols.ToArray();
            }
#endif
            Colors       = new List <RandomColors>();
            WardrobeSlot = slot;
        }
Exemplo n.º 3
0
        public UMAPackedRecipeBase.UMAPackRecipe GetPackedRecipe()
        {
            if (packedRecipe != null)
            {
                return(packedRecipe);
            }
            packedRecipe = (baseRaceRecipe as UMATextRecipe).PackedLoad(UMAContextBase.Instance);

            return(packedRecipe);
        }
Exemplo n.º 4
0
 /// <summary>
 /// Serialize recipeString data into packed recipe.
 /// </summary>
 /// <param name="packedRecipe">Packed recipe.</param>
 /// <param name="context">Context.</param>
 public override void PackedSave(UMAPackedRecipeBase.UMAPackRecipe packedRecipe, UMAContext context)
 {
     recipeString = JsonUtility.ToJson(packedRecipe);
 }