Exemple #1
0
 private void StopBtn_Click(object sender, RoutedEventArgs e)
 {
     if (!pl.IsInitialized())
     {
         return;
     }
     if (!thread.IsAlive)
     {
         thread.Start();
     }
     else if (pl.IsPlaying())
     {
         pl.Pause();
     }
     else if (!pl.IsPlaying())
     {
         pl.UnPause();
     }
 }
    public override void OnInspectorGUI()
    {
        /////
        GUILayout.BeginHorizontal();

        if (GUILayout.Button("Pause/Resume"))
        {
            if (PlayManager.IsUpdating)
            {
                PlayManager.Pause();
            }
            else
            {
                PlayManager.Resume();
            }
        }

        if (GUILayout.Button("Restart"))
        {
            PlayManager.PlayMusic();
        }

        GUILayout.EndHorizontal();

        /////
        GUILayout.BeginHorizontal();
        GUILayout.Label("Jump to timing");
        timing = EditorGUILayout.IntField(timing);
        if (GUILayout.Button("Go"))
        {
            PlayManager.PlayMusic(timing);
        }
        GUILayout.EndHorizontal();

        DrawDefaultInspector();
    }