I have a list of string items in a generic list inside a ScriptableObject that is editable in design time via an inspector panel.
I would like to display the contents of the currently selected list item in another label on the inspector panel so that the user knows which item in the generic list that they have currently selected.
Some of the inbuilt functionality of the editors are able to detect which items in a generic list the user has selected then open up the relevant inspector panel for editing, so I hope it is able to be done.
Is this possible?
asked Jan 15 '10 at 05:04 AM
You can achieve what you want by making a custom inspector for your scriptable object type. That custom inspector can use its own code to display your generic list of items, and it can also track which one you select, and then provide more information about that item.
For more information about extending the Unity editor:
Good luck, Lucas
answered Sep 11 '10 at 08:45 PM
Lucas Meijer 1 ♦♦
It's hard to tell from your question if you're talking about the built-in Inspector panel, or a panel that you've custom made.
If you're talking about the built-in Inspector panel, you can use the Selection class to access a list of all currently selected GameObjects.
If you're talking about a custom panel you've made, you may have to provide some more details. Specifically, how are you displaying the list of items on the panel, and how do you get the currently selected item elsewhere in your code when you actually do something with it?
answered Jan 15 '10 at 05:40 AM