Example #1
0
            public override void OnInspectorGUI()
            {
#if false
                if (null == FindObjectOfType <MySyntheStation>())
                {
                    EditorGUILayout.HelpBox("MyMMLBox requires MySyntheStation", MessageType.Warning);
                }
#endif
                {
                    var curSyntheStation = FindObjectOfType <MySyntheStation>();
                    if (curSyntheStation != syntheStation)
                    {
                        syntheStation = curSyntheStation;
                        if (sequencer != null)
                        {
                            sequencer.Stop(0.0f);
                            syntheStation.RemoveSequencer(sequencer);
                            sequencer = null;
                        }
                    }
                }
                serializedObject.Update();
                EditorGUILayout.PropertyField(serializedObject.FindProperty("player"));
                EditorGUILayout.PropertyField(serializedObject.FindProperty("audioSource"));
                editorGUILayout_Clips(serializedObject.FindProperty("clips"));
                serializedObject.ApplyModifiedProperties();
            }
 private void OnDisable()
 {
     if (sequencer != null)
     {
         sequencer.Stop(0.0f);
         syntheStation.RemoveSequencer(sequencer);
         sequencer = null;
     }
     syntheStation = null;
 }
Example #3
0
 void OnDisable()
 {
     //Debug.Log("OnDisable:" + Application.isPlaying);
     if (sequencer == null)
     {
         return;
     }
     if (sequencer.Playing)
     {
         sequencer.Stop(0.0f);
     }
     if (syntheStation != null)
     {
         syntheStation.RemoveSequencer(sequencer);
     }
     clip      = null;
     sequencer = null;
     state     = PlayState.Stopped;
 }
Example #4
0
 private void OnDisable()
 {
     //Debug.Log("OnDisable:" + Application.isPlaying);
     if (sequencer == null)
     {
         return;
     }
     if (sequencer.Playing)
     {
         sequencer.Stop(0.0f);
     }
     if (syntheStation != null)
     {
         syntheStation.RemoveSequencer(sequencer);
     }
     sequencer.AppDataEvent     -= appDataEvent;
     sequencer.PlayingEvent     -= playingEvent;
     sequencer.NextSectionEvent -= nextSectionEvent;
     clip          = null;
     sequencer     = null;
     state         = PlayState.Stopped;
     syntheStation = null;
 }