I recently started using overriding after finding out how useful it can be. I’ve got that all down and it functionally works in my game how I want it to. The problem I’m having now is all the clutter in my inspector, all of the exposed properties from the parent class are also being shown on the child class, I don’t want this. I’ll try and make an example of what I mean:
public class Unit : MonoBehaviour
{
public int health; // <- this should only be visible on this script in the inspector
public virtual void Kill()
{
Destroy(this.gameObject);
}
}
public class Enemy : Unit
{
public override void Kill()
{
Debug.log("Death");
base.Kill()
}
}
Is what I want possible? I thought using custom inspector scripts would be the way to go, but it just seems unintuitive to make an entire script just to hide a few properties for every child class script, unless I’m not understanding it properly.