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

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

            if ((countPause % 2) != 0)
            {
                Bgm.Pause();
            }
            else
            {
                Bgm.Play();
            }
        }
예제 #4
0
 private void PlayBgm()
 {
     Bgm.BgmPath = BgmPath;
     Bgm.Play();
 }
예제 #5
0
 void OnDestroy()
 {
     EnemySpawner.Activate();
     Bgm.Play();
     Wall.Activate();
 }
예제 #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);
 }
예제 #7
0
 /*
  * 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();
 }
예제 #8
0
 public void Play()
 {
     bgm.Play();
 }