|
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?
(comments are locked)
|
|
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: http://unity3d.com/support/documentation/Components/gui-ExtendingEditor.html Good luck, Lucas hmm I do not think this answer is enough honestly. I have a similar problem that is knowing which item of a list is selected in the inspection window and surely that page does not help.
Nov 14 '12 at 04:03 PM
sebas77
(comments are locked)
|
|
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? Thanks for the reply Stelimar. I am talking about the built in inspector panel. When viewing an asset file the contents of any ScriptableObject are displayed in the inspector panel. If the ScriptableObject has a list inside it the list is displayed and you can edit and delete items in the list by resizing the capacity. I was wanting to detect the selected list item in the child list. Using Selection.activeObject only seems to give me the parent object. Not the selected child list item of the list that resides under the parent object. Hopefully that sort of clarifies things.
Jan 15 '10 at 06:03 AM
nathanp812
(comments are locked)
|
