public override void OnInspectorGUI() { try { GUI.changed = false; GUI.color = Color.white; if (MidiPlayerGlobal.CurrentMidiSet != null || MidiPlayerGlobal.CurrentMidiSet.MidiFiles == null || MidiPlayerGlobal.CurrentMidiSet.MidiFiles.Count == 0) { EditorGUILayout.BeginHorizontal(); EditorGUILayout.LabelField(new GUIContent("Select Midi ", "Select Midi File to play"), GUILayout.Width(150)); if (GUILayout.Button(new GUIContent(instance.MPTK_MidiIndex + " - " + instance.MPTK_MidiName, "Selected Midi File to load"), GUILayout.Height(30))) { InitWinSelectMidi(instance.MPTK_MidiIndex, MidiChanged); } EditorGUILayout.EndHorizontal(); instance.MPTK_KeepNoteOff = EditorGUILayout.Toggle(new GUIContent("Keep Midi NoteOff", "Keep Midi NoteOff and NoteOn with Velocity=0 (need to restart the playing Midi)"), instance.MPTK_KeepNoteOff); instance.MPTK_LogEvents = EditorGUILayout.Toggle(new GUIContent("Log Midi Events", "Log information about each midi events read."), instance.MPTK_LogEvents); EditorGUILayout.BeginHorizontal(); if (GUILayout.Button(new GUIContent("Load", ""))) { instance.MPTK_Load(); } if (GUILayout.Button(new GUIContent("Previous", ""))) { instance.MPTK_Previous(); instance.MPTK_Load(); } if (GUILayout.Button(new GUIContent("Next", ""))) { instance.MPTK_Next(); EditorGUILayout.EndHorizontal(); instance.MPTK_Load(); } EditorGUILayout.EndHorizontal(); } else { MidiCommonEditor.ErrorNoMidiFile(); } MidiCommonEditor.SetSceneChangedIfNeed(instance, GUI.changed); } catch (System.Exception ex) { MidiPlayerGlobal.ErrorDetail(ex); } }