public MainWindow()
 {
     // Creates the window.
     InitializeComponent();
     // Plays the background music when the window is launched.
     Bgm.Play();
 }
Exemple #2
0
        private void BtnClosePlay_Click(object sender, EventArgs e)
        {
            countClose++;

            if ((countClose % 2) != 0)
            {
                Bgm.Close();
            }
            else
            {
                Bgm.Play();
            }
        }
Exemple #3
0
        private void BtnBgmPause_Click(object sender, EventArgs e)
        {
            countPause++;

            if ((countPause % 2) != 0)
            {
                Bgm.Pause();
            }
            else
            {
                Bgm.Play();
            }
        }
Exemple #4
0
 private void PlayBgm()
 {
     Bgm.BgmPath = BgmPath;
     Bgm.Play();
 }
Exemple #5
0
 void OnDestroy()
 {
     EnemySpawner.Activate();
     Bgm.Play();
     Wall.Activate();
 }
Exemple #6
0
 /// <summary>
 /// 播放 背景音乐
 /// </summary>
 /// <param name="path">Sound.wz中路径</param>
 /// <param name="looping">是否循环</param>
 public void Play(string path, bool looping = true)
 {
     _bgm.Play(path, looping);
 }
 /*
  * This Event starts the BGM over when it finishes playing, causing it to loop.
  */
 private void Bgm_MediaEnded(object sender, RoutedEventArgs e)
 {
     Bgm.Position = TimeSpan.Zero;
     Bgm.Play();
 }
Exemple #8
0
 public void Play()
 {
     bgm.Play();
 }