Ejemplo n.º 1
0
    public void OnDrop(PointerEventData eventData)
    {
        GameObject givenPotion = eventData.pointerDrag;
        DragDrop   potionDrop  = givenPotion.GetComponent <DragDrop>();

        if (givenPotion.GetComponent <PotionDisplay>().potion == wantedPotion && customerState == State.AtPickup)
        {
            customerState = State.OrderReceived;
            StoreManager.AddGold(tipAmount);
            StoreManager.PromoteStars();
            potionDrop.CallItemSlot();
            Destroy(givenPotion);
            StartCoroutine(MoveDown());
        }
        else if (givenPotion.GetComponent <PotionDisplay>().potion != wantedPotion && customerState == State.AtPickup)
        {
            customerState = State.OrderReceived;
            StoreManager.DemoteStars();
            potionDrop.CallItemSlot();
            Destroy(givenPotion);
            tipAmount = 0;
            StoreManager.AddGold(tipAmount);
            StartCoroutine(MoveDown());
        }
    }