Hi. I’m building on a Custom Editor, and got stuck at following List>() …
Is it Possible however to display the List in a Custom Inspector?
my Idea was the Code below… but what a surprise it doesn’t work…
Script:
List<List<GameObjects>> m_GameObjects;
void OnEnable(){
m_GameObjects = new List<List<GameObject>>();
}
Editor:
MyPersonalScript myTarget;
SerializedProperty m_GameObjects;
public void OnEnable()
{
myTarget = (MyPersonalScript)target;
m_GameObjects.serializedObject.FindProperty("m_GameObjects");
}
public override OnInspectorGUI(){
serializedObject.Update();
for(int i = 0; i< m_GameObjects.arraySize;i++){
SerializedProperty m_objects = m_GameObjects.GetArrayElementAtIndex(i);
EditorGUILayout.PropertyField(m_objects,true);
}
serializedObject.ApplyModifiedProperties();
}
I hope somebody could help me out here!
_
dan