Hey guys, I’ve a question about a certain implementation I want to attempt. I have an abstract item as such,
public abstract class AbstractItem : PunBehaviour {
[Tooltip("Durability of the item. Destroys itself upon reaching 0 durability.")]
[SerializeField]
private int durability;
public int Durability
{
get { return durability; }
}
}
So any class that inherits from AbstractItem will have durability, so something like a weapon. But there are some items that shouldn’t have durability, such as a prop. Both prop and weapon inherits AbstractItem because of several functionalities that are shared. Structs and interfaces are not usable (structs can’t be shared with abstract? and interfaces do not allow fields) so besides putting durability in each class that uses it, is there a way to go about having durability available only to certain classes?
Thank you for any advice,
Andy