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; }
public ClipPreparingJob(MySyntheStation Station, MyMMLClip Clip, AssetBundle Bundle, bool DontGenerate) { station = Station; clip = Clip; bundle = Bundle; mmlText = clip.Text; clip.Dirty = false; clip.Unit = null; dontGenerate = DontGenerate; }
private void OnDisable() { if (syntheStation == null) { return; } foreach (var clip in clips) { clip.Flush(); } syntheStation = null; }
private void OnEnable() { syntheStation = FindObjectOfType <MySyntheStation>(); if (syntheStation == null) { return; } foreach (var clip in clips) { syntheStation.PrepareClip(clip); } }
private void OnEnable() { syntheStation = GameObject.FindObjectOfType <MySyntheStation>(); if (syntheStation == null) { return; } sequencer = new MyMMLSequencer(syntheStation.TickFrequency); syntheStation.AddSequencer(sequencer); sequencer.AppDataEvent += appDataEvent; sequencer.PlayingEvent += playingEvent; sequencer.NextSectionEvent += nextSectionEvent; state = PlayState.Stopped; //Debug.Log("start:" + Application.isPlaying); }
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; }
private void OnEnable() { syntheStation = FindObjectOfType <MySyntheStation>(); sequencer = null; }
void Start() { syntheStation = GameObject.FindObjectOfType <MySyntheStation>(); OnEnable(); }
void OnEnale() { syntheStation = FindObjectOfType <MySyntheStation>(); }