void OnMouseDown()
    {
        if (MenuManager.canOpenMenu())
        {
            switch (typeMinigame)
            {
            case MinigameType.water:
                Transform auxWater = minigameNotice.transform.Find("Name");
                auxWater.GetComponent <TextMeshProUGUI>().text = "Você deseja iniciar o minigame da Água com custo de 20 Caffeinas";
                minigameNotice.transform.Find("bt_Water").gameObject.SetActive(true);
                break;

            case MinigameType.cleaninig:
                Transform auxCleaning = minigameNotice.transform.Find("Name");
                auxCleaning.GetComponent <TextMeshProUGUI>().text = "Você deseja iniciar o minigame da Limpeza com custo de 20 Caffeinas";
                minigameNotice.transform.Find("bt_Cleaning").gameObject.SetActive(true);
                break;

            case MinigameType.nutrients:
                Transform auxNutrients = minigameNotice.transform.Find("Name");
                auxNutrients.GetComponent <TextMeshProUGUI>().text = "Você deseja iniciar o minigame de Nutrients com custo de 20 Caffeinas";
                minigameNotice.transform.Find("bt_Nutrients").gameObject.SetActive(true);
                break;
            }
            PlaySoundOnClick();
            minigameNotice.SetActive(true);
            MenuManager.MenuOpen();
            GameObject.Find("Canvas").GetComponent <canvasInvisibleSet>().reorder(minigameNotice);
        }
    }
Example #2
0
 void OnMouseDown()
 {
     if (MenuManager.canOpenMenu())
     {
         StoreUI.SetActive(true);
         PlaySoundOnClick();
         MenuManager.MenuOpen();
     }
 }
 void OnMouseDown()
 {
     if (MenuManager.canOpenMenu())
     {
         PlaySoundOnClick();
         GameObject.Find("Canvas").GetComponent <canvasInvisibleSet>().reorder(menu);
         menu.SetActive(true);
         MenuManager.MenuOpen();
     }
 }
    void Update()
    {
        if (!MenuManager.canOpenMenu())
        {
            foreach (var aux in notInteractButton)
            {
                aux.interactable = false;
            }
        }

        if (MenuManager.canOpenMenu())
        {
            foreach (var aux in notInteractButton)
            {
                aux.interactable = true;
            }
        }

        moneyTxt.text = PlayerPrefs.GetFloat("Money").ToString("C");
        if (PlayerPrefs.GetFloat("Money") < 0)
        {
            PlayerPrefs.SetFloat("Money", 0);
        }
    }
Example #5
0
 public void openMenu()
 {
     if (MenuManager.canOpenMenu())
     {
         if (!inTransition)
         {
             if (!isOpen)
             {
                 GetComponent <Animator>().Play("OpenRadialMenu");
                 setButtonInteractable(true);
                 Invoke("closeMenu", 8f);
             }
             else if (isOpen)
             {
                 GetComponent <Animator>().Play("CloseRadialMenu");
                 setButtonInteractable(false);
             }
             inTransition = true;
         }
     }
 }