- Home /
Make the Inspector only show a specific CustomEditor
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.
Answer by Fran-Martin · Feb 27, 2015 at 04:11 PM
Try this Hiding default transform handles
That wasn't really what I was ai$$anonymous$$g for. I want to make sure my script is expanded in the inspector and visible/scrolled to as a $$anonymous$$imum, but preferably that it's only my script and not the entire GameObject that is selected/shown in the inspector.
Your answer
Follow this Question
Related Questions
Custom ordering of variables in inspector when using base and derived classes 1 Answer
How to access one class instance in editor script? 1 Answer
How to make custom Inspectors for serialized classes 2 Answers
Gizmos.DrawLine is dissapearing after returning to editor after Playing the scene 0 Answers
Multiple Cars not working 1 Answer