Ejemplo n.º 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
        animMenuAlpha.SetTrigger("fade");
        Invoke("HideDelayed", fadeAlphaAnimationClip.length);


        //Debug.Log ("Game started in same scene! Put your game starting stuff here.");

        GlobalVar.SendMessage("ResetValues", SendMessageOptions.RequireReceiver);
        showPanels.ShowGameplayPanel();
    }