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,则该字段将出现。有解决方法吗?
| 归档时间: |
|
| 查看次数: |
577 次 |
| 最近记录: |