Пример #1
0
    // Update is called once per frame
    void Update()
    {
        var inventory = quizReception.GetItems();

        if (cntReceived < 2 && inventory.Count > 0)
        {
            if (inventory[0].name.IndexOf("Coin") > 0)
            {
                cntReceived++;
                if (mPieceBonus != null)
                {
                    itemsBox.MoveItemIn(mPieceBonus);
                }
                quizReception.GetRefuse().Add(inventory[0]);
                inventory.Clear();
            }
            else if (inventory[0].name.IndexOf("Booze") > 0)
            {
                mShowName[0].SetActive(false);
                mShowName[1].SetActive(true);
                cntReceived++;
                itemsBox.MoveItemIn(mAgreementBonus);
                quizReception.GetRefuse().Add(inventory[0]);
                inventory.Clear();
            }
            else
            {
                itemsBox.MoveItemIn(inventory[0]);
                inventory.Clear();
            }
        }
        if (cntReceived >= 2 && inventory.Count > 0)
        {
            itemsBox.MoveItemIn(inventory[0]);
            inventory.Clear();
        }
    }
Пример #2
0
    // Update is called once per frame
    void Update()
    {
        var inventory = quizReception.GetItems();

        // first a coin
        if (cntReceived == 0 && inventory.Count > 0)
        {
            cntReceived++;
            itemsBox.MoveItemIn(mPieceBonus);
            quizReception.GetRefuse().Add(inventory[0]);
            quizReception.RemoveItem(inventory[0]);
        }
        else if (inventory.Count > 0)
        {
            itemsBox.MoveItemIn(inventory[0]);
            quizReception.RemoveItem(inventory[0]);
        }
    }