stopAllEvents() public method

public stopAllEvents ( STOP_MODE mode ) : RESULT
mode STOP_MODE
return RESULT
    public void StopAllEvents()
    {
        if (!immediateStop)
        {
            bus.stopAllEvents(FMOD.Studio.STOP_MODE.ALLOWFADEOUT);
        }
        else
        {
            bus.stopAllEvents(FMOD.Studio.STOP_MODE.IMMEDIATE);
        }

        print(busPath + " STOP ALL EVENTS");
    }
Beispiel #2
0
    public void Restart()
    {
        playerstats.levelscore = 0;
        FMOD.Studio.PLAYBACK_STATE playbackState;

        SoundManager.songInstance.stop(FMOD.Studio.STOP_MODE.IMMEDIATE);
        SoundManager.songInstance.release();
        masterBus.stopAllEvents(FMOD.Studio.STOP_MODE.ALLOWFADEOUT);

        Cursor.visible   = false;
        Cursor.lockState = CursorLockMode.Locked;
        Time.timeScale   = 1;
        SceneManager.LoadScene(SceneManager.GetActiveScene().name);
        //soundManager.Start();


        GameController.musicBus.setPaused(false);
        GameController.sfxBus.setPaused(false);
        soundManager.RestartMusic();
        //SoundManager.songInstance = FMODUnity.RuntimeManager.CreateInstance("event:/Music/" + SoundManager.currentSongName + "bgm");

        //SoundManager.songInstance.start();
        SoundManager.songInstance.getPlaybackState(out playbackState);

        UnityEngine.Debug.Log(playbackState.ToString());
    }
Beispiel #3
0
 private void Start()
 {
     FMOD.Studio.Bus ambience = RuntimeManager.GetBus("bus:/Master/Sounds/Ambience");
     FMOD.Studio.Bus sfx      = RuntimeManager.GetBus("bus:/Master/Sounds/SFX");
     ambience.stopAllEvents(FMOD.Studio.STOP_MODE.ALLOWFADEOUT);
     sfx.stopAllEvents(FMOD.Studio.STOP_MODE.ALLOWFADEOUT);
 }
Beispiel #4
0
 void StopAllPlayerEvents()
 {
     FMOD.Studio.Bus musicBus = FMODUnity.RuntimeManager.GetBus("bank:/Music");
     FMOD.Studio.Bus hitBus   = FMODUnity.RuntimeManager.GetBus("bank:/Hit");
     musicBus.stopAllEvents(FMOD.Studio.STOP_MODE.IMMEDIATE);
     hitBus.stopAllEvents(FMOD.Studio.STOP_MODE.IMMEDIATE);
 }
Beispiel #5
0
 public void BackToMainMenu()
 {
     masterBus.stopAllEvents(FMOD.Studio.STOP_MODE.IMMEDIATE);
     RuntimeManager.PauseAllEvents(false);
     clickEvent.Play();
     SceneManager.LoadScene("Menu");
 }
Beispiel #6
0
 public void Stop()
 {
     Debug.Log("Stop Music");
     FMOD.Studio.Bus playerBus = FMODUnity.RuntimeManager.GetBus("Bus:/");
     playerBus.stopAllEvents(FMOD.Studio.STOP_MODE.IMMEDIATE);
     levelMusic.release();
 }
Beispiel #7
0
 private void Update()
 {
     if (Input.GetKeyDown(KeyCode.E) && enable)
     {
         fade.GetComponent <Animation>().Play("FadeOut_02");
         masterBus.stopAllEvents(FMOD.Studio.STOP_MODE.ALLOWFADEOUT); // stops all sound events
         StartCoroutine(NextLevel());
         enable = false;
     }
 }
Beispiel #8
0
 public void PlayBossMusic()
 {
     // start beat system again
     // stop level music and start boss music
     musicBus.stopAllEvents(FMOD.Studio.STOP_MODE.ALLOWFADEOUT);
     songInstance = FMODUnity.RuntimeManager.CreateInstance("event:/Music/bossbgm");
     bS           = GameObject.Find("Main Camera").GetComponent <BeatSystem>();
     bS.AssignBeatEvent(songInstance);
     songInstance.start();
     songInstance.release();
 }
Beispiel #9
0
    IEnumerator GameOver()
    {
        musicBus.stopAllEvents(FMOD.Studio.STOP_MODE.IMMEDIATE);
        sfxBus.stopAllEvents(FMOD.Studio.STOP_MODE.IMMEDIATE);
        FMODUnity.RuntimeManager.PlayOneShot("event:/UI/gameover"); // play sound
        yield return(new WaitForSeconds(2));

        gameOverPanel.SetActive(true);
        yield return(new WaitForSeconds(1));

        blockPanel.SetActive(false);
    }
Beispiel #10
0
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Escape))
        {
            Application.Quit();
            Debug.Log("Application Quit");
        }

        if (Input.GetKeyDown(KeyCode.Return))
        {
            MasterBus.stopAllEvents(FMOD.Studio.STOP_MODE.ALLOWFADEOUT);    // Stop All sounds before loading next Level
            SceneManager.LoadScene("StartMenu");
            Debug.Log("Start Menu Load");
        }
    }
 // Update is called once per frame
 void Update()
 {
     if (Input.GetKeyDown(KeyCode.Escape) || Input.GetKeyDown(KeyCode.P))
     {
         if (isPaused)
         {
             ResumeGame();
             return;
         }
         isPaused = true;
         pauseMenu.SetActive(true);
         toPauseText.SetActive(false);
         master.stopAllEvents(FMOD.Studio.STOP_MODE.IMMEDIATE);
         Time.timeScale = 0f;
     }
 }
Beispiel #12
0
    public void LeaveGame(bool audioFade = false)
    {
        FMOD.Studio.PARAMETER_DESCRIPTION pd;
        FMOD.Studio.PARAMETER_ID          EnemyDistID;

        FMODUnity.RuntimeManager.StudioSystem.getParameterDescriptionByName("Enemy Dist", out pd);
        EnemyDistID = pd.id;

        FMODUnity.RuntimeManager.StudioSystem.setParameterByID(EnemyDistID, 0f);

        LevelManager.Instance.SoundscapeEvent.stop(FMOD.Studio.STOP_MODE.IMMEDIATE);
        LevelManager.Instance.SoundscapeEvent.release();

        GameManager.Instance.RestartGame();

        if (!audioFade)
        {
            EverythingbutMenuBus.stopAllEvents(FMOD.Studio.STOP_MODE.IMMEDIATE);
        }
    }
Beispiel #13
0
    private IEnumerator EndMatch()
    {
        matchState = MatchState.Ending;

        if (tutorialScene)
        {
            _GameManager.instance.StartCoroutine(_GameManager.instance.LoadNewGame());

            Destroy(gameObject);
        }
        else
        {
            musicEvent.stop(FMOD.Studio.STOP_MODE.IMMEDIATE);
            RuntimeManager.PlayOneShot(endingSound);
            _GameManager.instance.playerControllers.Clear();
            if (matchByTime)
            {
                matchInfo.SetRankingsByKills();
            }

            cameraFollow.objectsToShow.Clear();
            cameraFollow.objectsToShow.Add(matchInfo.GetWinner().transform);
            cameraFollow.minZoom         = focusPlayerZoom;
            cameraFollow.positionDamping = 0f;
            matchInfo.GetWinner().gameObject.SetActive(true);
            matchInfo.GetWinner().rigidbody.velocity = Vector3.zero;
            matchInfo.GetWinner().rigidbody.isKinematic = true;

            yield return(new WaitForSeconds(timeToChangeScene));

            _GameManager.instance.SceneTransition.Play();

            yield return(new WaitForSeconds(_GameManager.instance.SceneTransition.clip.length));

            MasterBus.stopAllEvents(FMOD.Studio.STOP_MODE.ALLOWFADEOUT);

            SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex + 1);
        }
    }
Beispiel #14
0
 public void MusicStopImmediate()
 {
     FMOD.Studio.Bus musicBus = FMODUnity.RuntimeManager.GetBus("bus:/Master/Music");
     musicBus.stopAllEvents(FMOD.Studio.STOP_MODE.IMMEDIATE);
 }
Beispiel #15
0
 private void OnDestroy()
 {
     masterBus.stopAllEvents(FMOD.Studio.STOP_MODE.ALLOWFADEOUT);
 }
Beispiel #16
0
 public void MainMenu()
 {
     masterBus.stopAllEvents(FMOD.Studio.STOP_MODE.ALLOWFADEOUT);
     SceneManager.LoadScene(0);
 }
Beispiel #17
0
 //--------------------------------------------------------------------
 // 14: This section shows how to retrieve a bus, and how busses can be
 //     used to control multiple events. This can be usefull to stop
 //     one shots that are still playing but have no other way to be
 //     controlled.
 //--------------------------------------------------------------------
 void StopAllPlayerEvents()
 {
     FMOD.Studio.Bus playerBus = FMODUnity.RuntimeManager.GetBus("bus:/player");
     playerBus.stopAllEvents(FMOD.Studio.STOP_MODE.IMMEDIATE);
 }
Beispiel #18
0
 public void LoadMenu()
 {
     Time.timeScale = 1.0f;
     MasterBus.stopAllEvents(FMOD.Studio.STOP_MODE.ALLOWFADEOUT);
     SceneManager.LoadScene(0);
 }
Beispiel #19
0
 public void PlayAgain()
 {
     FMOD.Studio.Bus playerBus = FMODUnity.RuntimeManager.GetBus("Bus:/");
     playerBus.stopAllEvents(FMOD.Studio.STOP_MODE.IMMEDIATE);
     SceneManager.LoadScene("ToyToy", LoadSceneMode.Single);
 }
Beispiel #20
0
 public void MusicStop()
 {
     FMOD.Studio.Bus musicBus = FMODUnity.RuntimeManager.GetBus("bus:/Master/Music");
     musicBus.stopAllEvents(FMOD.Studio.STOP_MODE.ALLOWFADEOUT);
 }
Beispiel #21
0
 public void OnReplayButton()
 {
     MasterB.stopAllEvents(FMOD.Studio.STOP_MODE.ALLOWFADEOUT);
     SceneManager.LoadScene("MainWorld");
 }
Beispiel #22
0
 void OnDestroy()
 {
     FMOD.Studio.Bus playerBus = FMODUnity.RuntimeManager.GetBus("bus:/");
     playerBus.stopAllEvents(FMOD.Studio.STOP_MODE.IMMEDIATE);
     instance_e.release();
 }
Beispiel #23
0
 void StopMusic()
 {
     FMOD.Studio.Bus playerBus = FMODUnity.RuntimeManager.GetBus("bus:/player");
     playerBus.stopAllEvents(FMOD.Studio.STOP_MODE.IMMEDIATE);
     MusicState.release();
 }
 void OnDestroy()
 {
     FMOD.Studio.Bus playerBus = FMODUnity.RuntimeManager.GetBus("bus:/player");
     playerBus.stopAllEvents(FMOD.Studio.STOP_MODE.IMMEDIATE);
     raiseSpearSound.release();
 }
Beispiel #25
0
 public static void StopAllSounds()
 {
     FMOD.Studio.Bus playerBus = FMODUnity.RuntimeManager.GetBus("bus:/");
     playerBus.stopAllEvents(FMOD.Studio.STOP_MODE.ALLOWFADEOUT);
 }