void OnEnable() { try { instance = (MidiFileLoader)target; if (!Application.isPlaying) { // Load description of available soundfont if (MidiPlayerGlobal.CurrentMidiSet == null || MidiPlayerGlobal.CurrentMidiSet.ActiveSounFontInfo == null) { MidiPlayerGlobal.InitPath(); ToolsEditor.LoadMidiSet(); ToolsEditor.CheckMidiSet(); } } if (winSelectMidi != null) { //Debug.Log("OnEnable winSelectMidi " + winSelectMidi.Title); winSelectMidi.SelectedItem = instance.MPTK_MidiIndex; winSelectMidi.Repaint(); winSelectMidi.Focus(); } //EditorApplication.playModeStateChanged += EditorApplication_playModeStateChanged; } catch (System.Exception ex) { MidiPlayerGlobal.ErrorDetail(ex); } }
void OnEnable() { try { instance = (MidiFilePlayer)target; //Debug.Log("MidiFilePlayerEditor OnEnable " + instance.MPTK_MidiIndex); //Debug.Log("OnEnable MidiFilePlayerEditor"); CustomEventStartPlayMidi = serializedObject.FindProperty("OnEventStartPlayMidi"); CustomEventListNotesEvent = serializedObject.FindProperty("OnEventNotesMidi"); CustomEventEndPlayMidi = serializedObject.FindProperty("OnEventEndPlayMidi"); if (!Application.isPlaying) { // Load description of available soundfont if (MidiPlayerGlobal.CurrentMidiSet == null || MidiPlayerGlobal.CurrentMidiSet.ActiveSounFontInfo == null) { MidiPlayerGlobal.InitPath(); ToolsEditor.LoadMidiSet(); ToolsEditor.CheckMidiSet(); } } if (winSelectMidi != null) { //Debug.Log("OnEnable winSelectMidi " + winSelectMidi.Title); winSelectMidi.SelectedItem = instance.MPTK_MidiIndex; winSelectMidi.Repaint(); winSelectMidi.Focus(); } //EditorApplication.playModeStateChanged += EditorApplication_playModeStateChanged; } catch (System.Exception ex) { MidiPlayerGlobal.ErrorDetail(ex); } }