HideMenu() публичный Метод

public HideMenu ( ) : void
Результат void
Пример #1
0
    IEnumerator loadAfterZoom()
    {
        showPanels.HideMenu();
        yield return(new WaitForSeconds(animationSpeed));

        LoadDelayed();
    }
Пример #2
0
    public void StartButtonClicked()
    {
        //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)
        {
            playMusic.FadeDown(fadeColorAnimationClip.length);
        }

        //If changeScenes is true, start fading and change scenes halfway through animation when screen is blocked by FadeImage
        if (changeScenes)
        {
            //LoadSceneNumber(0);
            //Use invoke to delay calling of LoadDelayed by half the length of fadeColorAnimationClip
            Invoke("LoadDelayed", fadeColorAnimationClip.length * .5f);

            //Set the trigger of Animator animColorFade to start transition to the FadeToOpaque state.
            animColorFade.SetTrigger("fade");
            showPanels.HideMenu();
            LoadSceneNumber(0);

            //LoadDelayed();
        }

        //If changeScenes is false, call StartGameInScene
        else
        {
            //Call the StartGameInScene function to start game without loading a new scene.
            StartGameInScene();
        }
    }
    /*
     * void OnEnable()
     * {
     *  SceneManager.sceneLoaded += SceneWasLoaded;
     * }
     *
     * void OnDisable()
     * {
     *  SceneManager.sceneLoaded -= SceneWasLoaded;
     * }*/


    public void LoadDelayed()
    {
        inMainMenu = false;

        showPanels.HideMenu();

        SceneManager.LoadScene(sceneToStart);
    }
Пример #4
0
    public void LoadDelayed()
    {
        inMainMenu = false;

        showPanels.HideMenu();


        Application.LoadLevel(BasicLoad);
    }
    public void LoadDelayed()
    {
        inMainMenu = false;

        showPanels?.HideMenu();

        SceneManager.LoadScene(sceneToStart);

        Invoke("ResetScript", fadeColorAnimationClip.length * .5f);
    }
Пример #6
0
    IEnumerator waitForLoad()
    {
        Debug.Log("Starting to wait");
        yield return(new WaitForSeconds(2));

        SceneManager.LoadScene("Level 1");
        fadeOutImageCanvasGroup.alpha = 0;
        showPanels.HideMenu();
        Debug.Log("Loaded Level 1 set alpha to 0");
    }
Пример #7
0
    public void LoadDelayed()
    {
        //Pause button now works if escape is pressed since we are no longer in Main menu.
        inMainMenu = false;

        //Hide the main menu UI element
        showPanels.HideMenu();

        //Load the selected scene, by scene index number in build settings
        Application.LoadLevel("levelintro");
    }
Пример #8
0
    public void LoadDelayed()
    {
        //Pause button now works if escape is pressed since we are no longer in Main menu.
        inMainMenu = false;

        //Hide the main menu UI element
        showPanels.HideMenu();

        //Load the selected scene, by scene index number in build settings
        SceneManager.LoadScene(sceneToStart);
    }
 void ReturnToMenu()
 {
     playMusic.PlaySelectedMusic(0, musicFadeInTime);
     if (PlayerPrefs.HasKey("GameState") && PlayerPrefs.GetString("GameState") == "GameOver")
     {
         showPanels.HideMenu();
         showPanels.ShowGameOverPanel();
         PlayerPrefs.DeleteKey("GameState");
     }
     FadeIn();
 }
Пример #10
0
    public void LoadDelayed()
    {
        //Pause button now works if escape is pressed since we are no longer in Main menu.
        inMainMenu = false;

        //Hide the main menu UI element
        showPanels.HideMenu();

        //Begin loading the game scene
        StartCoroutine(LoadDelayedAsync());
    }
Пример #11
0
    public void LoadDelayed()
    {
        //Pause button now works if escape is pressed since we are no longer in Main menu.
        inMainMenu = false;

        //Hide the main menu UI element
        showPanels.HideMenu();

        //Load the selected scene, by scene index number in build settings
        SceneManager.LoadScene(sceneToStart);
        StartCoroutine(FadeCanvasGroupAlpha(fadeOutImageCanvasGroup.alpha, 0f, fadeOutImageCanvasGroup));
    }
    public IEnumerator LoadDelayed(float delay)
    {
        //Load the selected scene, by scene index number in build settings
        AsyncOperation async = SceneManager.LoadSceneAsync(sceneToStart);

        yield return(async);

        //Pause button now works if escape is pressed since we are no longer in Main menu.
        inMainMenu = false;

        //Hide the main menu UI element
        showPanels.HideMenu();
    }
Пример #13
0
    public void LoadDelayedNextScene2()
    {
        //Pause button now works if escape is pressed since we are no longer in Main menu.
        inMainMenu = false;

        //Hide the main menu UI element
        showPanels.HideMenu();

        //change game state to playing
        GameStateMachine.myGameState = GameStateMachine.GameState.PLAYING;

        //Load the selected scene, by scene index number in build settings
        SceneManager.LoadScene(scene2);
    }
Пример #14
0
 private void LoadDelayedGame()
 {
     // Hide the main menu UI element
     showPanels.HideMenu();
     showPanels.HideVersion();
     // Hide the Level panel UI element
     showPanels.HideLevelsPanel();
     m_bThanksPanel = false;
     // Hide the Congratulations panel UI element and
     // show the HUD panel UI element
     Pause.current.UnCongratulation();
     // Load the selected scene, by scene index number in build settings
     StartCoroutine(AsyncLoading(sceneToGo));
 }
Пример #15
0
    public void LoadDelayed()
    {
        //Pause button now works if escape is pressed since we are no longer in Main menu.
        inMainMenu = false;

        //Hide the main menu UI element
        showPanels.HideMenu();

        playMusic.musicSource.Stop();          // added for Hex-a-cute

        //Load the selected scene, by scene index number in build settings
                #if UNITY_5_3
        SceneManager.LoadScene(sceneToStart);
                #endif
    }
Пример #16
0
    public void LoadDelayed()
    {
        //Pause button now works if escape is pressed since we are no longer in Main menu.
        inMainMenu = false;

        //Hide the main menu UI element
        showPanels.HideMenu();

        //Load the selected scene, by scene index number in build settings
        Camera.main.enabled = false;
        GameObject background = GameObject.FindGameObjectWithTag("Background");

        background.active = false;
        SceneManager.LoadSceneAsync(sceneToStart, LoadSceneMode.Additive);
    }
Пример #17
0
    public void StartButtonClicked()
    {
        showPanels.HideMenu();
        if (changeScenes)
        {
            Invoke("LoadDelayed", fadeColorAnimationClip.length * 2f);


            animColorFade.SetTrigger("fade");
        }

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

        //Hide the main menu UI element
        showPanels.HideMenu();
        if (changeMusicOnStart)
        {
            PlayNewMusic();
        }

        //Load the selected scene, by scene index number in build settings
        StartCoroutine(LoadAsynchronously(sceneToStart));
        //SceneManager.LoadScene (sceneToStart);
    }
Пример #19
0
 public void HideDelayed()
 {
     //changed this during migration of functions, if performance issues become problematic, revisit this=====================
     showPanels = FindObjectOfType <ShowPanels>();
     //Hide the main menu UI element after fading out menu for start game in scene
     showPanels.HideMenu();
 }
Пример #20
0
    public IEnumerator HideDelayed()
    {
        yield return(new WaitForSecondsRealtime(FadeAlphaAnimationClip.length));

        _showPanels.HideMenu();
        AnimMenuAlpha.ResetTrigger("fade");
    }
Пример #21
0
    public void LoadDelayed()
    {
        //Pause button now works if escape is pressed since we are no longer in Main menu.
        inMainMenu = false;

        //Hide the main menu UI element
        showPanels.HideMenu();

        //Load the selected scene, by scene index number in build settings
        //SceneManager.LoadScene(sceneToStart);
        //SceneManager.
        //SceneManager.Loa
        if (PhotonNetwork.isMasterClient)
        {
            level.loadScene("First Scene");
        }
    }
Пример #22
0
    public void LoadDelayed()
    {
        //Pause button now works if escape is pressed since we are no longer in Main menu.
        inMainMenu = false;

        //Hide the main menu UI element
        showPanels.HideMenu();

        logo.SetActive(false);

        //Load the selected scene, by scene index number in build settings
#if UNITY_5_3_OR_NEWER
        SceneManager.LoadScene(sceneToStart);
#else
        Application.LoadLevel(sceneToStart);
#endif
    }
Пример #23
0
    public void LoadDelayed()
    {
        //Pause button now works if escape is pressed since we are no longer in Main menu.
        inMainMenu = false;

        //Hide the main menu UI element
        showPanels.HideMenu();

        //Load the selected scene, by scene index number in build settings
        Application.LoadLevel(sceneToStart);

        animMenuAlpha.SetTrigger("fade");

        //Wait until game has started, then hide the main menu
        Invoke("HideDelayed", fadeAlphaAnimationClip.length);

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

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

        //Hide the main menu UI element
        showPanels.HideMenu();

        //Load the selected scene, by scene index number in build settings
        if (_navigatingToGame)
        {
            navigator.NavigateToGameScene();
        }
        else
        {
            navigator.NavigateToVictoryScene();
        }

        StartCoroutine(FadeCanvasGroupAlpha(1f, 0f, fadeOutImageCanvasGroup));
    }
Пример #25
0
    public void LoadDelayed()
    {
        //Pause button now works if escape is pressed since we are no longer in Main menu.
        inMainMenu = false;

        //Hide the main menu UI element
        showPanels.HideMenu();

        //Load the first scene if we're in the menu, otherwise reload the current scene.
        int currentScene = SceneManager.GetActiveScene().buildIndex;

        if (currentScene == 0)
        {
            SceneManager.LoadScene(sceneToStart);
        }
        else
        {
            SceneManager.LoadScene(currentScene);
        }
    }
Пример #26
0
    public void Start()
    {
        m_ShowPanels = GameObject.Find("Canvas").GetComponent <ShowPanels>();
        m_Quit       = GameObject.Find("Canvas").GetComponent <QuitApplication>();
        m_SoundFx    = GameObject.Find("Canvas/SoundFx").GetComponent <AudioSource>();
        m_Anim       = GetComponent <Animator>();

        onClick.RemoveAllListeners();

        switch (button)
        {
        case ButtonType.Level:
            onClick.AddListener(() => {
                m_SoundFx.clip = soundClip;
                m_SoundFx.Play();
                m_ShowPanels.HideMenu();
                m_ShowPanels.ShowLevelsPanel();
            });
            break;

        case ButtonType.Option:
            onClick.AddListener(() => {
                m_SoundFx.clip = soundClip;
                m_SoundFx.Play();
                m_ShowPanels.ShowOptionsPanel();
                m_ShowPanels.HideMenu();
            });
            break;

        case ButtonType.Quit:
            onClick.AddListener(() => {
                m_SoundFx.clip = soundClip;
                m_SoundFx.Play();
                m_Quit.Quit();
            });
            break;
        }

        m_Anim.SetTrigger("Hide");
    }
Пример #27
0
    // Update is called once per frame
    void Update()
    {
        showPanels = GameObject.FindGameObjectWithTag("UI").GetComponent <ShowPanels>();



        if (Input.GetKey(KeyCode.LeftControl) & (Input.GetKey(KeyCode.R)))     // Change this if you want to start the experiment some other way

        {
            SceneManager.LoadScene("Begin 1");
            showPanels.HideMenu();
        }
    }
Пример #28
0
    public void LoadDelayed()
    {
        //Pause button now works if escape is pressed since we are no longer in Main menu.
        inMainMenu = false;

        //changed this during migration of functions, if performance issues become problematic, revisit this=====================
        showPanels = FindObjectOfType <ShowPanels>();

        //Hide the main menu UI element
        showPanels.HideMenu();

        //Load the selected scene, by scene index number in build settings
        SceneManager.LoadScene(sceneToStart);
    }
Пример #29
0
    private ShowPanels showPanels;                                                                              //Reference to ShowPanels script on UI GameObject, to show and hide panels


    void Awake()
    {
        //Get a reference to ShowPanels attached to UI object
        showPanels = GetComponent <ShowPanels> ();

        //Get a reference to PlayMusic attached to UI object
        playMusic = GetComponent <PlayMusic> ();

        // **** ver se é o local correto;

        showPanels.HideGameplayPanel();
        showPanels.ShowIntro();
        showPanels.HideMenu();
        showPanels.HideEndGamePanel();
    }
Пример #30
0
    public void StartButtonClicked()
    {
        camerasss.transform.position = startingPosition;

        //If changeMusicOnStart is true, fade out volume of music group of AudioMixer by calling FadeDown function of PlayMusic
        //To change fade time, change length of animation "FadeToColor"
        if (menuSettingsData.musicLoopToChangeTo != null)
        {
            playMusic.FadeDown(menuSettingsData.menuFadeTime);
        }

        //If changeScenes is true, start fading and change scenes halfway through animation when screen is blocked by FadeImage
        if (sceneToStart != 0)
        {
            StartCoroutine(FadeCanvasGroupAlpha(0f, 1f, fadeOutImageCanvasGroup));
            StartCoroutine(LoadNextScene(sceneToStart));
            //Pause button now works if escape is pressed since we are no longer in Main menu.
            inMainMenu = false;

            //Hide the main menu UI element
            showPanels.HideMenu();
        }
    }