Stop() public method

Stops music
public Stop ( ) : void
return void
Example #1
0
    private void StopMusic()
    {
        MusicController music = FindObjectOfType <MusicController>();

        if (music != null)
        {
            music.Stop();
        }
    }
Example #2
0
        protected override void OnPreShow()
        {
            base.OnPreShow();

            MusicController.Stop();
            MusicController.MountAudio(null);
            MusicController.OnEnd += OnMusicEnd;

            RequestMapsets();
        }
Example #3
0
        /// <summary>
        /// Resets currentlying previewing mapset.
        /// </summary>
        private void ResetPreviewingMapset()
        {
            if (previewingMapset.Value == null)
            {
                return;
            }

            MusicController.Stop();
            MusicController.MountAudio(null);
            musicAgent.Remove();
            previewingMapset.Value = null;
        }
Example #4
0
 public void NextStrip()
 {
     GameObject.FindGameObjectWithTag("Player").GetComponent <PlayerHealth> ().Hide();          // Qué cutre!
     currentStrip++;
     if (currentStrip >= strips.Length)
     {
         SceneManager.LoadScene("Credits");
     }
     else
     {
         cameraController.NextStrip(strips[currentStrip]);
         musicController.Stop();
         musicController.PlayChangeStripClip();
     }
 }
        public void TestBeatmapBackgroundWithStoryboardClockAlwaysUsesCurrentTrack()
        {
            BackgroundScreenBeatmap nestedScreen    = null;
            WorkingBeatmap          originalWorking = null;

            setSupporter(true);
            setSourceMode(BackgroundSource.BeatmapWithStoryboard);

            AddStep("change beatmap", () => originalWorking = Beatmap.Value = createTestWorkingBeatmapWithStoryboard());
            AddAssert("background changed", () => screen.CheckLastLoadChange() == true);
            AddUntilStep("wait for beatmap background to be loaded", () => getCurrentBackground()?.GetType() == typeof(BeatmapBackgroundWithStoryboard));

            AddStep("start music", () => MusicController.Play());
            AddUntilStep("storyboard clock running", () => screen.ChildrenOfType <DrawableStoryboard>().SingleOrDefault()?.Clock.IsRunning == true);

            // of note, this needs to be a type that doesn't match BackgroundScreenDefault else it is silently not pushed by the background stack.
            AddStep("push new background to stack", () => stack.Push(nestedScreen = new BackgroundScreenBeatmap(Beatmap.Value)));
            AddUntilStep("wait for screen to load", () => nestedScreen.IsLoaded && nestedScreen.IsCurrentScreen());

            // we're testing a case where scheduling may be used to avoid issues, so ensure the scheduler is no longer running.
            AddUntilStep("wait for top level not alive", () => !screen.IsAlive);

            AddStep("stop music", () => MusicController.Stop());
            AddStep("change beatmap", () => Beatmap.Value      = createTestWorkingBeatmapWithStoryboard());
            AddStep("change beatmap back", () => Beatmap.Value = originalWorking);
            AddStep("restart music", () => MusicController.Play());

            AddAssert("top level background hasn't changed yet", () => screen.CheckLastLoadChange() == null);

            AddStep("pop screen back to top level", () => screen.MakeCurrent());

            AddStep("top level screen is current", () => screen.IsCurrentScreen());
            AddAssert("top level background reused existing", () => screen.CheckLastLoadChange() == false);
            AddUntilStep("storyboard clock running", () => screen.ChildrenOfType <DrawableStoryboard>().Single().Clock.IsRunning);

            AddStep("stop music", () => MusicController.Stop());
            AddStep("restore default beatmap", () => Beatmap.SetDefault());
        }
        public void InvokeSoftInit()
        {
            // Initialize score processor
            ScoreProcessor = Model.ModeService.CreateScoreProcessor();
            ScoreProcessor.ApplyMap(CurrentMap);
            ScoreProcessor.OnLastJudgement += InvokeCompletion;

            MusicController.Stop();
            MusicController.SetFade(1f);

            // Show game gui.
            GameGui.ShowGame(() =>
            {
                MusicController.Play(LeadInTime);

                // Start listening to application pause event.
                Game.OnAppPause += OnAppPaused;
                Game.OnAppFocus += OnAppFocused;

                IsPlaying = true;

                OnSoftInit?.Invoke();
            });
        }
Example #7
0
 public void OnGameEnd()
 {
     Components.Clear();
     musicController.Stop();
     gameEnd = true;
 }
Example #8
0
 public void MainMenu()
 {
     Resume();
     musicController.Stop();
     SceneManager.LoadScene("MainMenu");
 }