Exemplo n.º 1
0
    public override void Activate(GameObject target)
    {
        var inventory = target.GetComponent <IInventory>();

        if (inventory == null)
        {
            return;
        }

        if (EconomyManager.IsGold(record))
        {
            inventory.AddItem(EconomyManager.Gold, record.Data.Value);
        }
        else
        {
            inventory.AddItem(record, quantity);
        }

        record.PickupSound.PlaySoundAtPoint(transform.position);
        Destroy(gameObject);
    }