the problem is the gameobject window picker just disappears after a clicking somewhere.
problem video: - YouTube
// vearth class
void OnEnable() {
Vearth target = this;
int TOP_PADDING = 2;
m_TreesObjectsSO = new SerializedObject(target);
m_ReorderableList = new ReorderableList(m_TreesObjectsSO, m_TreesObjectsSO.FindProperty("TreesObjects"), true, true, true, true);
m_ReorderableList.drawHeaderCallback = (rect) => EditorGUI.LabelField(rect, "Trees");
m_ReorderableList.drawElementCallback = (Rect rect, int index, bool isActive, bool isFocused) =>
{
rect.y += TOP_PADDING;
rect.height = EditorGUIUtility.singleLineHeight;
EditorGUI.PropertyField(rect, m_ReorderableList.serializedProperty.GetArrayElementAtIndex(index), GUIContent.none);
};
}
// ongui somewhere
EditorGUILayout.BeginVertical(SectionStyle); {
Vearth vearth = EditorWindow.GetWindow<Vearth>();
if(vearth.m_TreesObjectsSO != null)
{
vearth.m_TreesObjectsSO.Update();
vearth.m_ReorderableList.DoLayoutList();
vearth.m_TreesObjectsSO.ApplyModifiedProperties();
}
} EditorGUILayout.EndVertical();