Can someone please explain why I am getting this error even though it is an override? Is this a bug in unity or am I doing something wrong?
Error:
The same field name is serialized multiple times in the class or its parent class. This is not supported: Base(ShieldCustomInspector) <LastEditor>k__BackingField
Relevant Code:
[CustomEditor(typeof(Item),true)]//customizes the item class in the inspector
public class ItemCustomInspector : Editor
{
public virtual string LastEditor { get; set; } = "item";
public override void OnInspectorGUI()
{
if(LastEditor == "item")
{
//draw crap that I want to have at the very end of my inspector only once
}
}
}
[CustomEditor(typeof(HeldItem),true)]//customizes the item class in the inspector
public class HeldItemCustomInspector : ItemCustomInspector
{
public override string LastEditor { get; set; } = "heldItem";
public override void OnInspectorGUI()
{
if (LastEditor == "heldItem")
{
//draw crap that I want to have at the very end of my inspector only once
}
}
}
[CustomEditor(typeof(Shield), true)]//customizes the item class in the inspector
public class ShieldCustomInspector : HeldItemCustomInspector
{
public override string LastEditor { get; set; } = "shield";
public override void OnInspectorGUI()
{
if (LastEditor == "shield")
{
//draw crap that I want to have at the very end of my inspector only once
}
}
}