public void PurchaseSelectedItem() { if (currentSelectedItem.gunItem != null) { if (gm.money >= currentSelectedItem.itemCost) { gm.money -= currentSelectedItem.itemCost; gunM.AddGun(currentSelectedItem.gunItem); ResetItemManagers(); currentSelectedItem = null; } else { Debug.Log("Not Enough Money to buy " + currentSelectedItem.itemName); } } }
public void AddGun() { if (gm.money >= item.itemCost) { if (!gunM.GunExists(item.gunItem)) { gunM.AddGun(item.gunItem); gm.money -= item.itemCost; } else { Debug.Log("Gun Already In Inventory"); } } else { Debug.Log("Not Enough Money"); } }