public void DeleteItem(int _itemID) { inventorySCR.DeleteItem(_itemID); RefreshDisplays(); inventorySCR.AddItemToInventory(_itemID); gameObject.SetActive(false); }
private void OnTriggerEnter(Collider other) { ItemInventory player = other.gameObject.GetComponent <ItemInventory>(); if (player != null && inventoryItem.GetComponent <ItemData>() != null) { player.AddItemToInventory(inventoryItem.GetComponent <ItemData>()); Destroy(gameObject); } }
private void OnTriggerEnter(Collider other) { ItemInventory player = other.gameObject.GetComponent <ItemInventory>(); //StateManager playerA = collision.gameObject.GetComponent<StateManager>(); if (player != null && inventoryItem.GetComponent <GrapplingHook>() != null) { player.AddItemToInventory(inventoryItem.GetComponent <GrapplingHook>()); //instantiate the weapon model in the players hand set inactive to be invisible. player.AddItemModel(this, inventoryItem.GetComponent <GrapplingHook>(), player.hardpointsManager.Hardpoints, player.hand); Destroy(gameObject); } }
public void ClaimReward() { if (goldReward > 0) { playerStats.GainGold(goldReward); } if (foodReward > 0) { playerStats.GainFood(foodReward); } if (cannonballReward > 0) { playerStats.GainCannonball(cannonballReward); } if (itemReward != null) { inventory.AddItemToInventory(itemReward.itemID); } }
public void BuyWeapon(int itemID) { inventory.AddItemToInventory(itemID); }