Пример #1
0
 public void EpisodeEnabled(GameObject ep)
 {
     if (TalkBalloon_2.GetComponent <TalkBalloon> ().NumberOfTalk() >= 20)
     {
         ep.SetActive(true);
     }
     else
     {
         ep.SetActive(false);
     }
 }
Пример #2
0
    // Update is called once per frame
    void Update()
    {
        if (!DialogPanel.activeSelf)
        {
            //soda event
            ShopItem.GetComponent <Item> ().load();
            if (ShopItem.GetComponent <Item> ().haveItem() && Penguin.enabled && sodaBoughtTimes < 1)
            {
                ShopItem.GetComponent <Item> ().decreaseItem();
                sodaBoughtTimes++;
                PlayerPrefs.SetString("SodaEventShow", "True");                                 // show event save.
                SceneManager.LoadScene("Penguin Event");
            }

            //soda
            if (VisitFriend.GetComponent <VisitFriend> ().VisitNumber >= openVisitCount)
            {
                buyButton.GetComponent <Button> ().enabled = true;
                ShopItem.GetComponent <Button> ().enabled  = true;
                QuestionBox.SetActive(false);
                if (!IsAlreadyOpen)
                {
                    PopUpText.text = "이제 상점에서 <형제소다>를 구입할 수 있습니다!";
                    PopUpClose.SetActive(true);
                    PopUp.SetActive(true);
                    IsAlreadyOpen = true;
                }
            }

            //Episode
            if (TalkBalloon_2.GetComponent <TalkBalloon> ().NumberOfTalk() == 20)
            {
                if (!IsAlreadyOpen2)
                {
                    SceneManager.LoadScene("PenguinEp");
                    IsAlreadyOpen2 = true;
                }
            }
        }
        save();
    }