Example #1
0
    public void Quit()
    {
        SceneManagerStatic.GameQuit();

        /*
         * IEnumerator SpecialDelayRoutine3(float delayDuration)
         * {
         *  Debug.Log("Coroutine entry");
         *  yield return new WaitForSeconds(delayDuration);
         *  Debug.Log("Coroutine Exit");
         *  SceneManagerStatic.GameQuit();
         * }
         *
         * Cursor.lockState = CursorLockMode.Locked;
         * audioManagerAmbient.FadeOutSound(0.5f);
         *
         * //start the sound effect and get its duration to the variable delayDuration ('SceneSwitchSoundEffect' returns float)
         * AudioClip pertinentAudioClip;
         * if (audioManagerSoundEffects.sceneToSoundMatch.TryGetValue(quitCode, out pertinentAudioClip))
         * {
         *  delayDuration = pertinentAudioClip.length;
         *  audioManagerSoundEffects.SceneSwitchSoundEffect(quitCode);
         *  Debug.Log("delayDuration" + delayDuration);
         * }
         * else
         * {
         *  delayDuration = 0.5f;
         *  Debug.Log("delayDuration" + delayDuration);
         * }
         *
         * StartCoroutine(SpecialDelayRoutine3(delayDuration));
         */
    }
Example #2
0
 //base method:
 void ChangeScene(int sceneIndex)
 {
     Debug.Log("Loading scene with Index " + sceneIndex);
     //no more buttons clicked after this:
     Cursor.lockState = CursorLockMode.Locked;
     //have the music stop before the sound effect starts!
     audioManagerAmbient.FadeOutSound(0.5f);
     SceneManagerStatic.LoadNScene(sceneIndex);
 }
Example #3
0
    IEnumerator DelayCoroutine(float delayDuration, int sceneIndex)
    {
        if (gameStateManager != null)
        {
            //    gameStateManager.UnPauseGame();
        }
        Debug.Log("Coroutine entry " + Time.time);
        yield return(new WaitForSeconds(delayDuration));

        Debug.Log("Coroutine Exit" + Time.time);
        SceneManagerStatic.LoadNScene(sceneIndex);
    }
Example #4
0
    public void LoadNextLevel()
    {
        Debug.Log("Loading screen scene index is " + (SceneManager.GetActiveScene().buildIndex + 1));
        SceneManagerStatic.LoadNextScene();


        IEnumerator SpecialDelayRoutine2(float delayDuration)
        {
            Debug.Log("Coroutine entry");
            yield return(new WaitForSeconds(delayDuration));

            Debug.Log("Coroutine Exit");
            SceneManagerStatic.LoadNextScene();
        }
    }
Example #5
0
    //special transitions:

    public void Reload()
    {
        SceneManagerStatic.ReloadScene();


        Debug.Log("Loading screen scene index is " + SceneManager.GetActiveScene().buildIndex);


        IEnumerator SpecialDelayRoutine(float delayDuration, int sceneIndex)
        {
            Debug.Log("Coroutine entry");
            yield return(new WaitForSeconds(delayDuration));

            Debug.Log("Coroutine Exit");
            SceneManagerStatic.ReloadScene();
        }
    }