// 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]); } }
// Update is called once per frame void Update() { if (quizReception.GetItems().Count > 0) { //cntReceived++; itemsBox.MoveItemIn(quizReception.GetItems()[0]); quizReception.RemoveItem(quizReception.GetItems()[0]); } }
// Update is called once per frame void Update() { if (mStRed == STATE.CAN_GIVE || mStGreen == STATE.CAN_GIVE) { if (mStGreen == STATE.CAN_GIVE && Common.Utils.ClickedOn(this.gameObject)) { mStGreen = STATE.GAVE; this.GetComponent <SpriteRenderer>().sprite = mSpVide; mItemsBox.MoveItemIn(mLiguidGreen); } if (mStRed == STATE.CAN_GIVE && Common.Utils.ClickedOn(this.gameObject)) { mStRed = STATE.GAVE; this.GetComponent <SpriteRenderer>().sprite = mSpVide; mItemsBox.MoveItemIn(mLiguidRed); } return; } foreach (var it in mQuizReception.GetItems()) { if (mStGreen == STATE.HAS && Common.Utils.TrimClone(it.name) == mLiguidGreen.name) { mStGreen = STATE.CAN_GIVE; this.GetComponent <SpriteRenderer>().sprite = mSpGreen; mQuizReception.RemoveItem(it); return; } if (mStRed == STATE.HAS && Common.Utils.TrimClone(it.name) == mLiguidRed.name) { mStRed = STATE.CAN_GIVE; this.GetComponent <SpriteRenderer>().sprite = mSpRed; mQuizReception.RemoveItem(it); return; } } }