Beispiel #1
0
    //Toggle menu, pausing game
    public void ToggleMenu()
    {
        // Play animation for closing/opening menu and set properties - menu.alpha is set via animator
        if (menu.alpha > 0)
        {
            menuAnim.Play("MenuClose");
            SoundManager.SoundInstance.PlaySound("ButtonEnter");
            //menu.alpha = 0;
            menu.blocksRaycasts = false;
            isMenu         = false;
            Time.timeScale = 1;
        }
        else if (menu.alpha == 0)
        {
            menuAnim.Play("MenuOpen");
            SoundManager.SoundInstance.PlaySound("ButtonEnter");
            menu.blocksRaycasts = true;
            isMenu         = true;
            Time.timeScale = 0;
        }

        if (isMenu)
        {
            menuNav.NavMenu(0);
        }
    }
Beispiel #2
0
 // Initialize submenu once menu open animation has finished using animation event
 public void OnMenuOpened()
 {
     menuNav.NavMenu(0);
 }