- Home /
Inspector Editor, can 2or more Components be group together in a single Tab?
Hi,
Let say that I have Components A_Manager, A1,A2,A3.... and so on.
All of them are inherited from MonoBehaviour. But A1,A2,A3 do not run on their own, and are called from A_Manager.
In the Inspector, instead of Having each Component shown individually, Is it possible to have A1,A2,A3's properties be grouped under A_Manager?
Answer by Jamora · Dec 20, 2013 at 07:53 PM
The simplest way would be to have code like this in your custom editor for A_Manager, assuming all your A-classes have a shared type:
A[] aComponents;
void Awake(){ Reset(); }
void Reset(){
aComponents = gameObject.GetComponents<A>();
}
To hide the A-classes, just have
hideFlags = HideFlags.HideInInspector;
in its Reset method.
Thanks Jamora, As far as I know [HideInInspector] only hide the Variables, but not the Component itself. Am I right?
Seems like you are correct, I assumed it would work for classes too. Nevertheless, setting the object's hideflags to HideInInspector (in, e.g. the Reset method) will make it invisible in the inspector.
Your answer
Follow this Question
Related Questions
Making a tile editor 1 Answer
Editor Raycast Not Centered 0 Answers
Are there any simplified level editors? 2 Answers
Random Spawnpoints 1 Answer