예제 #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);
        }
예제 #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;
        }
예제 #3
0
        public UMAPackedRecipeBase.UMAPackRecipe GetPackedRecipe()
        {
            if (packedRecipe != null)
            {
                return(packedRecipe);
            }
            packedRecipe = (baseRaceRecipe as UMATextRecipe).PackedLoad(UMAContextBase.Instance);

            return(packedRecipe);
        }
예제 #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);
 }