private void AddCollectionRecipe(UMAWardrobeCollection uwc, string recipeName) { if (string.IsNullOrEmpty(recipeName)) { return; } AssetItem recipeAsset = UMAAssetIndexer.Instance.GetAssetItem <UMAWardrobeRecipe>(recipeName); if (recipeAsset != null) { UMAWardrobeRecipe uwr = recipeAsset.Item as UMAWardrobeRecipe; if (uwr == null) { Debug.Log("Null recipe in wardrobe collection..."); return; } List <AssetItem> items = UMAAssetIndexer.Instance.GetAssetItems(uwr, true); foreach (AssetItem recipeitem in items) { if (recipeitem.Item is SlotDataAsset) { AddSlotFromCollection(recipeitem.Item as SlotDataAsset, uwc); } if (recipeitem.Item is OverlayDataAsset) { AddOverlayFromCollection(recipeitem.Item as OverlayDataAsset, uwc); } } } }
private void GenerateCollectionLabels() { //********************************************************************************************** //* Add Wardrobe Collections //********************************************************************************************** Type theType = UMAAssetIndexer.Instance.GetIndexedType(typeof(UMAWardrobeCollection)); var wardrobecollections = UMAAssetIndexer.Instance.GetAssetDictionary(theType).Values; foreach (AssetItem ai in wardrobecollections) { UMAWardrobeCollection uwc = ai.Item as UMAWardrobeCollection; string Label = uwc.name; HashSet <string> collectionRecipes = new HashSet <string>(); foreach (var recipeName in uwc.arbitraryRecipes) { AddCollectionRecipe(uwc, recipeName); } foreach (var ws in uwc.wardrobeCollection.sets) { foreach (var wsettings in ws.wardrobeSet) { string recipeName = wsettings.recipe; AddCollectionRecipe(uwc, recipeName); } } } }
private void AddSlotFromCollection(SlotDataAsset slotDataAsset, UMAWardrobeCollection uwc) { if (!SlotTracker.ContainsKey(slotDataAsset.GetInstanceID())) { SlotTracker.Add(slotDataAsset.GetInstanceID(), new List <UMATextRecipe>()); } SlotTracker[slotDataAsset.GetInstanceID()].Add(uwc); }
private void AddOverlayFromCollection(OverlayDataAsset overlayDataAsset, UMAWardrobeCollection uwc) { if (!OverlayTracker.ContainsKey(overlayDataAsset.GetInstanceID())) { OverlayTracker.Add(overlayDataAsset.GetInstanceID(), new List <UMATextRecipe>()); } OverlayTracker[overlayDataAsset.GetInstanceID()].Add(uwc); foreach (Texture tex in overlayDataAsset.textureList) { if (!TextureTracker.ContainsKey(tex.GetInstanceID())) { TextureTracker.Add(tex.GetInstanceID(), new List <UMATextRecipe>()); } TextureTracker[tex.GetInstanceID()].Add(uwc); } }