Unity可为空的整数作为检查器字段

Que*_*n3r 5 c# unity-game-engine

Serializable为检查员创建了一个类。

[Serializable]
public class CellType
{
    [SerializeField]
    public int? Cost; // This does not appear in the inspector

    [SerializeField]
    public Color MaterialColor;
}
Run Code Online (Sandbox Code Playgroud)

可为空的字段Cost不会出现在检查器中。我通过创建一个SerializeField

[SerializeField]
private CellType[] types;
Run Code Online (Sandbox Code Playgroud)

如果该字段Cost为默认int,则该字段将出现。有解决方法吗?