Example #1
0
        new protected void OnEnable()
        {
            base.OnEnable();
            myScript = target as AudioFileMusicObject;

            SetupIcons();
            EditorApplication.update += Update;
            Undo.undoRedoPerformed   += OnUndoRedo;
            AudioPlaybackToolEditor.CreateAudioHelper(myScript.GetFile(), true);
            Undo.postprocessModifications += ApplyHelperEffects;

            loopMode          = FindProp("loopMode");
            clampToLoopPoints = FindProp("clampToLoopPoints");
            loopStartProperty = FindProp("loopStart");
            loopEndProperty   = FindProp("loopEnd");
        }
        new protected void OnEnable()
        {
            base.OnEnable();

            EditorApplication.update      += Update;
            Undo.undoRedoPerformed        += OnUndoRedo;
            Undo.postprocessModifications += ApplyHelperEffects;

            if (target.name.Length > 0) // Creating from right-click dialog throws error here because name is invalid when first selected
            {
                //safeName.stringValue = JSAMEditorHelper.ConvertToAlphanumeric(target.name);
            }

            neverRepeat = serializedObject.FindProperty("neverRepeat");

            fadeInDuration  = serializedObject.FindProperty("fadeInDuration");
            fadeOutDuration = serializedObject.FindProperty("fadeOutDuration");

            openIcon = EditorGUIUtility.TrIconContent("d_ScaleTool", "Click to open Playback Preview in a standalone window");

            AudioPlaybackToolEditor.CreateAudioHelper(asset.GetFirstAvailableFile());
        }