private void CreatePoseSet(string fileName)
        {
            SlotDataAsset sda = CustomAssetUtility.CreateAsset <SlotDataAsset>("", false, fileName + "_Slot", false);

            sda.slotName = sda.name;
            sda.nameHash = UMAUtils.StringToHash(sda.slotName);

            DynamicDNAConverterController ddcc = UMA.CustomAssetUtility.CreateAsset <DynamicDNAConverterController>("", false, fileName + "_Controller", false);

            sda.slotDNA = ddcc;


            DynamicUMADnaAsset duda = UMA.CustomAssetUtility.CreateAsset <DynamicUMADnaAsset>("", false, fileName + "_DNAAsset", false);

            ddcc.DNAAsset = duda;

            UMABonePose bp = UMA.CustomAssetUtility.CreateAsset <UMABonePose>("", true, fileName + "_Pose", false);
            BonePoseDNAConverterPlugin bpdcp = (BonePoseDNAConverterPlugin)ddcc.AddPlugin(typeof(BonePoseDNAConverterPlugin));

            bpdcp.poseDNAConverters.Add(new BonePoseDNAConverterPlugin.BonePoseDNAConverter());
            bpdcp.poseDNAConverters[0].poseToApply        = bp;
            bpdcp.poseDNAConverters[0].startingPoseWeight = 1.0f;


            EditorUtility.SetDirty(sda);
            EditorUtility.SetDirty(ddcc);
            EditorUtility.SetDirty(duda);
            EditorUtility.SetDirty(bp);
            EditorUtility.SetDirty(bpdcp);
            if (addToLibrary)
            {
                UMAAssetIndexer.Instance.EvilAddAsset(typeof(SlotDataAsset), sda);
                UMAAssetIndexer.Instance.EvilAddAsset(typeof(DynamicUMADnaAsset), duda);
                EditorUtility.SetDirty(UMAAssetIndexer.Instance);
            }

            if (createWardrobeRecipe)
            {
                string            path = CustomAssetUtility.GetAssetPathAndName <UMAWardrobeRecipe>(fileName, false);
                UMAWardrobeRecipe uwr  = UMAEditorUtilities.CreateRecipe(path, sda, null, fileName, addToLibrary);
                uwr.compatibleRaces = new List <string>();
                uwr.wardrobeSlot    = "Physique";
                uwr.compatibleRaces.Add(raceNames[selectedRace]);
                EditorUtility.SetDirty(uwr);
            }

            AssetDatabase.SaveAssets();
        }
Esempio n. 2
0
 public static void CreateDynamicUMADnaAsset()
 {
     CustomAssetUtility.CreateAsset <DynamicUMADnaAsset>();
 }
Esempio n. 3
0
 public static void CreateRendererAsset()
 {
     CustomAssetUtility.CreateAsset <UMARendererAsset>();
 }