예제 #1
0
        protected override void OnCreatePreset(string[] input)
        {
            presetDescription.stringValue = input[1];
            serializedObject.ApplyModifiedProperties();
            Preset newPreset = new Preset(asset as AudioFileMusicObject);

            newPreset.excludedProperties = new string[] {
                "file", "files", "useLibrary", "category"
            };
            string path = JSAMSettings.Settings.PresetsPath + "/" + input[0] + ".preset";

            JSAMEditorHelper.CreateAssetSafe(newPreset, path);
        }
예제 #2
0
        void GenerateAudioFileObjects <T>(Preset preset) where T : BaseAudioFileObject
        {
            string folder = outputFolder.stringValue;

            for (int i = 0; i < asset.files.Count; i++)
            {
                var newObject = CreateInstance <T>();
                preset.ApplyTo(newObject);
                newObject.file = asset.files[i];
                string finalPath = folder + "/" + asset.files[i].name + ".asset";
                JSAMEditorHelper.CreateAssetSafe(newObject, finalPath);
            }
            EditorUtility.FocusProjectWindow();
        }