I created a Serializable
class for my inspector.
[Serializable]
public class CellType
{
[SerializeField]
public int? Cost; // This does not appear in the inspector
[SerializeField]
public Color MaterialColor;
}
The nullable field Cost
does not appear in the inspector. I use this class by creating a SerializeField
[SerializeField]
private CellType[] types;
If the field Cost
would be a default int the field would appear. Is a workaround possible?