在自定义检查器中隐藏检查器时无法查看列表的子项
Cant view children of a list when hideininspector in custom inspector
我在 Unity 中遇到了一点问题,所以我制作了一个列表和一个布尔值
and i scripted it so that when the bool is pressed, the list is revealed
And here, you can see that i can open the list with no problem and view the contents
但是,我希望原件不显示,所以我添加了 [HideInInspector]
But now when i press the bool, it shows the list, BUT, i cant view nor edit the content of list
我该如何解决这个问题?
谢谢!
P.S: 这是我的代码
public override void OnInspectorGUI()
{
DrawDefaultInspector();
QuizManager myScript = target as QuizManager;
if (myScript.ShowList) {
var property = serializedObject.FindProperty("AList");
serializedObject.Update();
EditorGUILayout.PropertyField(property,true);
}
}
我在 Unity 中遇到了一点问题,所以我制作了一个列表和一个布尔值
and i scripted it so that when the bool is pressed, the list is revealed
And here, you can see that i can open the list with no problem and view the contents
但是,我希望原件不显示,所以我添加了 [HideInInspector]
But now when i press the bool, it shows the list, BUT, i cant view nor edit the content of list
我该如何解决这个问题?
谢谢!
P.S: 这是我的代码
public override void OnInspectorGUI()
{
DrawDefaultInspector();
QuizManager myScript = target as QuizManager;
if (myScript.ShowList) {
var property = serializedObject.FindProperty("AList");
serializedObject.Update();
EditorGUILayout.PropertyField(property,true);
}
}