Example #1
0
    public void answer()
    {
        btnSendItem.gameObject.SetActive(false);
        textNum.text = "";

        if (ItemSelectedController.getSelectedItem().getText() == answerName)
        {
            if (hasQuantity)
            {
                if (int.TryParse(quantity.text, out decoy) && answerNum == int.Parse(quantity.text))
                {
                    ShopSounds1.instance.playSound("win");
                }
                else
                {
                    ShopSounds1.instance.playSound("fail");
                    lifeNum.reduceScore();
                }
            }
            else
            {
                ShopSounds1.instance.playSound("win");
            }
        }
        else
        {
            ShopSounds1.instance.playSound("fail");
            lifeNum.reduceScore();
        }


        customerNum.reduceCustomers();
        anim.SetInteger("animState", 2);
    }
Example #2
0
 void OnMouseDown()
 {
     anim.SetBool("click", true);
     ShopSounds1.instance.playSound("click");
     ItemSelectedController.selectMe(this);
 }