public bool CanEquipItem(ItemSO item) { if (item as ShoeSO) { if (playerShoes == null) { playerShoes = (ShoeSO)item; return(true); } } else if (item as ArmorSO) { if (playerArmor == null) { playerArmor = (ArmorSO)item; return(true); } } else if (item as GunSO) { if (playerGun == null) { playerGun = (GunSO)item; return(true); } } return(false); }
public void EquipItem(ItemSO item) { Debug.LogError("Getting item: " + item.itemName); if (item as ShoeSO) { if (playerShoes == null) { playerShoes = (ShoeSO)item; } } else if (item as ArmorSO) { if (playerArmor == null) { playerArmor = (ArmorSO)item; this.armor = playerArmor.armourAmount; Debug.LogError("Setting Armor: " + playerArmor.armourAmount + " from: " + playerArmor.itemName); } } else if (item as GunSO) { if (playerGun == null) { playerGun = (GunSO)item; this.ammo = playerGun.ammoAmount; Debug.LogError("Setting ammo: " + playerGun.ammoAmount + " from: " + playerGun.itemName); } } }
public void UnEquipItem(int index) { if (index == 0) { playerShoes = null; } else if (index == 1) { playerArmor = null; } else if (index == 2) { playerGun = null; } }
public void UpdateItemsUI(ShoeSO shoe, ArmorSO armor, GunSO gun) { SetActiveItemImage(shoe, 0); SetActiveItemImage(armor, 1); SetActiveItemImage(gun, 2); }