Example #1
0
        private static IEnumerator FadeOutExit()
        {
            FadeMusic.FadeOutMusic();
            SceneChanger.FadeToScene();
            yield return(new WaitForSeconds(1));

            Application.Quit();
        }
Example #2
0
 protected override void Initialize()
 {
     base.Initialize();
     footDust.Stop();
     jumpDust.Stop();
     stateMachine.Initialize(idleState);
     fadeMusic = GameObject.Find("MusicPlayer").GetComponent <FadeMusic>();
 }
Example #3
0
        private static IEnumerator FadeOutMainMenu()
        {
            FadeMusic.FadeOutMusic();
            SceneChanger.FadeToScene();
            yield return(new WaitForSeconds(1));

            SceneManager.LoadScene("MainMenuBox");
        }
        private static IEnumerator NextScene()
        {
            FadeMusic.FadeOutMusic();
            SceneChanger.FadeToScene();
            yield return(new WaitForSeconds(1));

            SceneChanger.NextScene();
        }
Example #5
0
    // Start is called before the first frame update
    void Start()
    {
        S           = this;
        musicFader  = this.GetComponentInChildren <FadeMusic>();
        fadeInMusic = true;

        soundMgr = this.GetComponent <AudioSource>();
        startGame();
    }
Example #6
0
    void Start()
    {
        m_SoundFader = GetComponent <FadeMusic>();

        //Make sure the pointer is disabled
        EnablePointer(false);

        //Make sure player can move
        Time.timeScale = 1;
    }
Example #7
0
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else
     {
         Destroy(gameObject);
     }
     DontDestroyOnLoad(instance);
 }
    // Use this for initialization
    void Start()
    {
        // Find object with has the script ScrollGameOverText
        GameObject textScroll = GameObject.FindGameObjectWithTag("Finish");

        // Get a reference to script ScrollGameOverText
        sTxt = textScroll.GetComponent <ScrollGameOverText>();

        // Find camera with script on it
        GameObject camera = GameObject.FindGameObjectWithTag("MainCamera");

        // Get reference to script FadeMusic
        fm = camera.GetComponent <FadeMusic>();

        // Get reference to script GameControl
        gc = camera.GetComponent <GameControl>();
    }// End Start()
    // Use this for initialization
    void Start () {

        // Find object with has the script ScrollGameOverText
        GameObject textScroll = GameObject.FindGameObjectWithTag("Finish");

        // Get a reference to script ScrollGameOverText
        sTxt = textScroll.GetComponent<ScrollGameOverText>();

        // Find camera with script on it
        GameObject camera = GameObject.FindGameObjectWithTag("MainCamera");

        // Get reference to script FadeMusic
        fm = camera.GetComponent<FadeMusic>();

        // Get reference to script GameControl
        gc = camera.GetComponent<GameControl>();

    }// End Start()
Example #10
0
 public void FadeOutMusic()
 {
     backgroundMusic = GameObject.Find("Main Camera").GetComponent <AudioSource>();
     StartCoroutine(FadeMusic.StartFade(backgroundMusic, duration, targetVolume));
 }