Beispiel #1
0
        private static void ProcessSlot(IUMAMorphSetContainer container, IUMARecipeItem item,
                                        Action <DynamicCharacterAvatar, UMATextRecipe> process)
        {
            var morphs  = container.MorphSet;
            var umaRace = morphs.RaceData.raceName;
            var recipe  = item.Recipes.FirstOrDefault(r => r.compatibleRaces.Contains(umaRace));

            if (recipe == null)
            {
                return;
            }

            var avatar = morphs.Avatar;

            process(avatar, recipe);

            avatar.BuildCharacter();
        }
Beispiel #2
0
 public static void RemoveRecipeItem(this IUMAMorphSetContainer container, IUMARecipeItem item) =>
 ProcessSlot(container, item, (avatar, recipe) => avatar.ClearSlot(recipe.wardrobeSlot));
Beispiel #3
0
 public static void AddRecipeItem(this IUMAMorphSetContainer container, IUMARecipeItem item) =>
 ProcessSlot(container, item, (avatar, recipe) => avatar.SetSlot(recipe));