void Refresh()
 {
     if (parentWindow != null)
     {
         parentWindow.Repaint();
     }
 }
Esempio n. 2
0
        public override void OnInspectorGUI()
        {
            EditorGUI.BeginChangeCheck();
            AudioBlender blender = (AudioBlender)target;

            Undo.RecordObject(blender, "Edit Audio Blender");
            blender.serializeObject.edit = editorWindow != null;
            base.OnInspectorGUI();
            EditorGUILayout.Space();
            if (Application.isPlaying)
            {
                EditorGUILayout.BeginHorizontal();
                if (BlendaEditorGUI.EditorLayoutSelectableButton(new GUIContent(playContent), true, blender.isPlaying))
                {
                    blender.Play();
                }
                if (BlendaEditorGUI.EditorLayoutSelectableButton(new GUIContent(pauseContent), true, blender.isPaused))
                {
                    blender.Pause();
                }
                if (BlendaEditorGUI.EditorLayoutSelectableButton(new GUIContent(stopContent)))
                {
                    blender.Stop();
                }
                EditorGUILayout.EndHorizontal();
            }
            EditorGUILayout.Space();

            for (int i = 0; i < blender.sequenceCount; i++)
            {
                if (SequenceField(blender.GetSequence(i), blender.serializeObject.selection == i))
                {
                    Repaint();
                    renameSequence = null;
                    blender.serializeObject.selection = i;
                }
            }
            GUI.color = Color.white;
            EditorGUILayout.Space();
            if (GUILayout.Button("Add Sequence"))
            {
                blender.AddSequence("Sequence " + (blender.sequenceCount + 1));
            }
            if (EditorGUI.EndChangeCheck() && editorWindow != null)
            {
                editorWindow.Repaint();
            }
        }
Esempio n. 3
0
        private void OnGUI()
        {
            if (editorWindow == null)
            {
                Close();
                return;
            }

            EditorGUIUtility.labelWidth = 60;
            track.mute   = EditorGUILayout.Toggle("Mute", track.mute);
            track.volume = EditorGUILayout.Slider("Volume", track.volume, 0f, 1f);
            if (GUI.changed)
            {
                editorWindow.Repaint();
            }
            EditorGUIUtility.labelWidth = 0;
        }