how to select a custom class type instance form the scene with ObjectField.
i have a class KeyItem witch derives from Item witch derives from scriptable Object. all fields are serialized and the class itself is also serializable.
this is my EditorGUI line:
keyItem =EditorGUILayout.ObjectField(keyItem,typeof(KeyItem),true)as KeyItem;
and so how can i see the keyItems that reside in the scene view.
keyItems get created with a custom editor window, they have a field for a prefab as graphical presentation of the KeyItem and on that prefab is a script “collectItem” derived from monobehaviour that holds my instance of the KeyItem . It’s that instance i want to be able to select in the ObjectField search window.
i could set the ObjectField to the script collectItem qnd then check if the Item is a KeyItem, but surely there has to be a way to do this directly.
thx
J.