Ejemplo n.º 1
0
 public void DeleteItem(int _itemID)
 {
     inventorySCR.DeleteItem(_itemID);
     RefreshDisplays();
     inventorySCR.AddItemToInventory(_itemID);
     gameObject.SetActive(false);
 }
Ejemplo n.º 2
0
    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);
        }
    }
Ejemplo n.º 4
0
 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);
     }
 }
Ejemplo n.º 5
0
 public void BuyWeapon(int itemID)
 {
     inventory.AddItemToInventory(itemID);
 }