Example #1
0
 private void Start()
 {
     if (MiniMusicPlayer.Instance() != null)
     {
         MiniMusicPlayer.Instance().DestroyMe();
     }
 }
    public void Pauser()
    {
        pause = !pause;
        MiniMusicPlayer.Instance().FadeMusicOnPause(pause);
        pauseWindow.gameObject.SetActive(pause);

        Time.timeScale = pause ? 0 : 1;
        //Debug.Log("paused? " + pause);
        //Debug.Log("Timescale " + Time.timeScale);
    }
    public void Reload()
    {
        if (GameManager.Instance().IsPaused())
        {
            GameManager.Instance().Pauser();
        }

        MiniMusicPlayer.Instance().RestartPitch();
        MiniMusicPlayer.Instance().Initialize();
        SceneManager.LoadScene(SceneManager.GetActiveScene().name);
    }
 public void NextLevel()
 {
     if (GameManager.Instance())
     {
         if (GameManager.Instance().IsPaused())
         {
             GameManager.Instance().Pauser();
         }
     }
     if (MiniMusicPlayer.Instance())
     {
         MiniMusicPlayer.Instance().DestroyMe();
     }
     Debug.Log("nextLevel: " + nextLevel);
     SceneManager.LoadScene(nextLevel);
 }
    public void NextLevel(string theNextLevel)
    {
        if (GameManager.Instance())
        {
            if (GameManager.Instance().IsPaused())
            {
                GameManager.Instance().Pauser();
            }
        }
        if (MiniMusicPlayer.Instance())
        {
            MiniMusicPlayer.Instance().DestroyMe();
        }

        SceneManager.LoadScene(theNextLevel);
    }
    public void Exit()
    {
        if (GameManager.Instance())
        {
            if (GameManager.Instance().IsPaused())
            {
                GameManager.Instance().Pauser();
            }
        }

        if (MiniMusicPlayer.Instance())
        {
            MiniMusicPlayer.Instance().DestroyMe();
        }
        SceneManager.LoadScene(titleScreen);
    }
Example #7
0
    private void Awake()
    {
        DontDestroyOnLoad(this);

        if (!_instance)
        {
            //Debug.Log("first instance");
            _instance = this;

            music = GetComponent <AudioSource>();
        }
        else
        {
            Destroy(gameObject);
        }
    }
    public void NextLevel(float delay)
    {
        if (GameManager.Instance())
        {
            if (GameManager.Instance().IsPaused())
            {
                GameManager.Instance().Pauser();
            }
        }
        if (MiniMusicPlayer.Instance())
        {
            MiniMusicPlayer.Instance().DestroyMe();
        }

        StartCoroutine(NextLevelRoutine(delay));
        //Debug.Log("nextLevel: " + nextLevel);
    }