I have a manager (I use a singleton pattern) and I added a static method to it like so:
#if UNITY_EDITOR
[MenuItem("Edit/Project Settings/Inventory Types")]
public static void SetInInspector() {
Selection.activeObject = Instance;
}
#endif
(Instance
refers to the singleton of the manager.)
This makes the editor select the GameObject
that houses the instance of the manager and show it in the inspector. It’s a start. However, since the manager is only a component and the GameObject
can have many components, it really doesn’t feel clear what you are supposed to look at. Even worse, if the manager has been collapsed, it won’t expand when selected this way.
So is there a way to make the Inspector only show the editor for this component? Like what happens when you from the popup with the GameObject
tags selects to add a new tag.