Okay so I created a scriptable object thats an item, and I then created another srcriptable object class for specifically equipment, which inherited the item class. This (of course) brought over all of the ‘item’ class’es variables, which for now include how much health that item will restore to the player as a float. (“healthHeal”) However, since the equipment class inherits the item class, this means when you create a new equipment peice you can see you still have the option to change how much health it heals. I was wondering if there is a way to prevent specific variables from showing up in this instance, specifically so ‘healthHeal’ isnt shown when you are making a new equipment.
And thoughts?
Here is the item class:
public class Item : ScriptableObject {
new public string name = "New Item";
[TextArea]
public string description = "";
public Sprite icon = null;
public bool isDefaultItem = false;
public float healthHeal = 0f;
public ItemUse useText;
public virtual void Use() //item is used, something might happen.
{
DamageTextController.CreateDamageText(healthHeal.ToString(), PlayerController.globalPLayerPosition, "Green");
StatController.playerHealth = StatController.playerHealth + healthHeal;
}
}
Here is the equipment class:
public class Equipment : Item {
public EquipmentSlot equipSlot;
public int armorModifier;
public int damageModifier;
public override void Use()
{
//Equip the Item
EquipmentManager.instance.Equip(this);
}
}
public enum EquipmentSlot { Helmet, Chestplate, Boots, Weapon, Charm}