Пример #1
0
    public void StartGameInScene()
    {
        //Pause button now works if escape is pressed since we are no longer in Main menu.
        inMainMenu = false;

        //If changeMusicOnStart is true, fade out volume of music group of AudioMixer by calling FadeDown function of PlayMusic, using length of fadeColorAnimationClip as time.
        //To change fade time, change length of animation "FadeToColor"
        if (changeMusicOnStart)
        {
            //Wait until game has started, then play new music
            Invoke("PlayNewMusic", fadeAlphaAnimationClip.length);
        }
        //Set trigger for animator to start animation fading out Menu UI

        //Invoke("HideDelayed", fadeAlphaAnimationClip.length);
        HideDelayed();
        Debug.Log("Game started in same scene! Put your game starting stuff here.");
        GameController.Instance.PlayGame();
        showPanels.ShowInGame();
    }