Example #1
0
    public ShopContext1()
    {
        _items = new []
        {
            new ShopItem2 {
                Name = "Boots of Speed", Price = 450
            },
            new ShopItem2 {
                Name = "Power Treads", Price = 1400
            },
            new ShopItem2 {
                Name = "Phase Boots", Price = 1350
            },
            new ShopItem2 {
                Name = "Tranquil Boots", Price = 975
            },
            new ShopItem2 {
                Name = "Boots of Travel", Price = 2450
            },
            new ShopItem2 {
                Name = "Arcane Boots", Price = 1450
            },
        };

        StaticFeaturedItem  = _items[0];
        DynamicFeaturedItem = _items[0];
    }
Example #2
0
    // Update is called once per frame
    void Update()
    {
        // ShopItem3 = banana (crocodile banana event)
        ShopItem3.GetComponent <Item> ().load();
        if (ShopItem3.GetComponent <Item> ().haveItem() && VisitFriend.GetComponent <Image>().enabled&& !IsAlreadyShow)
        {
            IsAlreadyShow = true;
            SceneManager.LoadScene("Crocodile Event");
        }

        // crocodile event2
        if (VisitFriend.GetComponent <VisitFriend> ().VisitNumber >= eventVisitCount && VisitFriend.GetComponent <Image>().enabled&& !IsAlreadyShow2)
        {
            IsAlreadyShow2 = true;
            SceneManager.LoadScene("Crocodile Event2");
        }


        if (VisitFriend.GetComponent <VisitFriend> ().VisitNumber >= openVisitCount && !DialogPanel.activeSelf)
        {
//			ShopItem1.GetComponent<Button> ().enabled = true;
            ShopItem2.GetComponent <Button> ().enabled = true;
            ShopItem3.GetComponent <Button> ().enabled = true;
//			buyButton1.GetComponent<Button> ().enabled = true;
            buyButton2.GetComponent <Button> ().enabled = true;
            buyButton3.GetComponent <Button> ().enabled = true;
//			QuestionBox1.SetActive (false);
            QuestionBox2.SetActive(false);
            QuestionBox3.SetActive(false);
            if (!IsAlreadyOpen)
            {
                PopUpText.text = text;
                //				PopUpText.text = "이제 상점에서 <하겐다즈 망고라즈베리 파인트>와 <접이식 테이블>을 구입할 수 있습니다!";
                PopUpClose.SetActive(true);
                PopUp.SetActive(true);
                IsAlreadyOpen = true;
            }
        }

        if (VisitFriend.GetComponent <VisitFriend> ().VisitNumber >= openVisitCount2 && !DialogPanel.activeSelf)
        {
            ShopItem1.GetComponent <Button> ().enabled  = true;
            buyButton1.GetComponent <Button> ().enabled = true;
            QuestionBox1.SetActive(false);

            if (!IsAlreadyOpen2)
            {
                PopUpText.text = text2;
                //				PopUpText.text = "이제 상점에서 <하겐다즈 망고라즈베리 파인트>와 <접이식 테이블>을 구입할 수 있습니다!";
                PopUpClose.SetActive(true);
                PopUp.SetActive(true);
                IsAlreadyOpen2 = true;
            }
        }

        save();
    }
Example #3
0
    public void FeatureRandomItem()
    {
        ShopItem2 randomItem = null;

        while (randomItem == null || randomItem == StaticFeaturedItem)
        {
            randomItem = _items[Random.Range(0, _items.Length - 1)];
        }

        // Both sub-contexts are assigned here,
        // but only dynamic one will trigger the UI update.
        StaticFeaturedItem  = randomItem;
        DynamicFeaturedItem = randomItem;
    }
Example #4
0
 // Update is called once per frame
 void Update()
 {
     if ((Balloon.GetComponent <TalkBalloon> ().NumberOfTalk() >= NeedTalkCount) && !DialogPanel.activeSelf)
     {
         ShopItem1.GetComponent <Button> ().enabled  = true;
         ShopItem2.GetComponent <Button> ().enabled  = true;
         buyButton1.GetComponent <Button> ().enabled = true;
         buyButton2.GetComponent <Button> ().enabled = true;
         QuestionBox1.SetActive(false);
         QuestionBox2.SetActive(false);
         if (!IsAlreadyOpen)
         {
             PopUpText.text = "이제 상점에서 <" + ItemName1 + ">와 <" + ItemName2 + ">을 구입할 수 있습니다!";
             PopUpClose.SetActive(true);
             PopUp.SetActive(true);
             IsAlreadyOpen = true;
         }
     }
     save();
 }
Example #5
0
    // Update is called once per frame
    void Update()
    {
        if (VisitFriend.GetComponent <VisitFriend> ().VisitNumber >= openVisitCount && !DialogPanel.activeSelf)
        {
            ShopItem1.GetComponent <Button> ().enabled  = true;
            ShopItem2.GetComponent <Button> ().enabled  = true;
            buyButton1.GetComponent <Button> ().enabled = true;
            buyButton2.GetComponent <Button> ().enabled = true;
            QuestionBox1.SetActive(false);
            QuestionBox2.SetActive(false);
            if (!IsAlreadyOpen)
            {
                PopUpText.text = text;
//				PopUpText.text = "이제 상점에서 <하겐다즈 망고라즈베리 파인트>와 <접이식 테이블>을 구입할 수 있습니다!";
                PopUpClose.SetActive(true);
                PopUp.SetActive(true);
                IsAlreadyOpen = true;
            }
        }
        save();
    }
Example #6
0
 // Update is called once per frame
 void Update()
 {
     if (!DialogPanel.activeSelf)
     {
         if ((SheepBalloon.GetComponent <TalkBalloon> ().NumberOfTalk() >= SheepTalkCount) && (BearBalloon.GetComponent <TalkBalloon> ().NumberOfTalk() >= BearTalkCount))
         {
             ShopItem1.GetComponent <Button> ().enabled  = true;
             ShopItem2.GetComponent <Button> ().enabled  = true;
             buyButton1.GetComponent <Button> ().enabled = true;
             buyButton2.GetComponent <Button> ().enabled = true;
             QuestionBox1.SetActive(false);
             QuestionBox2.SetActive(false);
             if (!IsAlreadyOpen)
             {
                 PopUpText.text = "이제 상점에서 <탄산수>와 <킨더초콜렛>을 구입할 수 있습니다!";
                 PopUpClose.SetActive(true);
                 PopUp.SetActive(true);
                 IsAlreadyOpen = true;
             }
         }
     }
     save();
 }
Example #7
0
    // Update is called once per frame
    void Update()
    {
        if ((Balloon.GetComponent <TalkBalloon> ().NumberOfTalk() >= NeedTalkCount) && !DialogPanel.activeSelf)
        {
            ShopItem1.GetComponent <Button> ().enabled = true;
            ShopItem2.GetComponent <Button> ().enabled = true;
//			ShopItem3.GetComponent<Button> ().enabled = true;
            buyButton1.GetComponent <Button> ().enabled = true;
            buyButton2.GetComponent <Button> ().enabled = true;
//			buyButton3.GetComponent<Button> ().enabled = true;
            QuestionBox1.SetActive(false);
            QuestionBox2.SetActive(false);
//			QuestionBox3.SetActive (false);
            if (!IsAlreadyOpen)
            {
                PopUpText.text = text;
                PopUpClose.SetActive(true);
                PopUp.SetActive(true);
                IsAlreadyOpen = true;
            }
        }

        if ((Balloon.GetComponent <TalkBalloon> ().NumberOfTalk() >= NeedTalkCount2) && !DialogPanel.activeSelf)
        {
            ShopItem3.GetComponent <Button> ().enabled  = true;
            buyButton3.GetComponent <Button> ().enabled = true;
            QuestionBox3.SetActive(false);
            if (!IsAlreadyOpen2)
            {
                PopUpText.text = text2;
                PopUpClose.SetActive(true);
                PopUp.SetActive(true);
                IsAlreadyOpen2 = true;
            }
        }
        save();
    }