예제 #1
0
    private bool DragToSell(Item pItem, ItemSlot pSlot)
    {
        if (!ShopKeeper.playerIsInShop)
        {
            return(false);
        }
        if (_shopInventory == null)
        {
            _shopInventory = GameObject.Find("ShopInventory").GetComponent <ShopInventory>();
        }

        if (_shopInventory.IsFull())
        {
            GameController.errorMessage.AddMessage("Shop is Full!");
            return(false);
        }

        if (pItem != null)
        {
            _playerCoins.AddCoins(pItem.Value * pSlot.Amount);
            pItem.IsInShop = true;
            GameController.errorMessage.AddMessage(pItem.Name + " has been sold for " + pItem.Value + " Coins!", Color.green);
        }

        return(true);
    }
예제 #2
0
    public void SellTower()
    {
        PlayerCoins.AddCoins(tower.Stats.SellCost);
        AudioManager.Instance.PlayTowerSellAudio();
        Destroy(tower.gameObject);

        TouchInputManager.ButtonClicked = true;
    }
예제 #3
0
    public virtual void Die()
    {
        IsDead = true;

        PlayerCoins.AddCoins(coinsReward);
        animator.SetTrigger(EnemyAnimator.DEAD_TRIGGER);
        audioSource.Play();

        Movement.Disable();

        Invoke("Delete", 5);
    }