- Home /
Is it possible to create submenus in the "Component Browser" in Editor ?
Hello,
I have created an Unity3D plugin with the following namespace structure :
MyPlugin.Datas
MyPlugin.Scripts
MyPlugin.Scripts.Behaviours
MyPlugin.Scripts.Behaviours.[...]
MyPlugin.Scripts.Behaviours.[...].[...]
[...]
When the DLL is imported in Unity Editor, the "Component Browser" (displayed by clicking the "Add Component" button in the Inspector) shows me my scripts like this :
Components > Scripts > MyPlugin.Scripts
Components > Scripts > MyPlugin.Scripts.Behaviours
Components > Scripts > MyPlugin.Scripts.[...]
Components > Scripts > MyPlugin.Scripts.[...].[...]
Is it possible to modify this "Component Browser" behaviour so it can display my scripts like this ?
Components > Scripts > MyPlugin > Scripts
Components > Scripts > MyPlugin > Scripts > Behaviours
Components > Scripts > MyPlugin > Scripts > Behaviours > [...]
Components > Scripts > MyPlugin > Scripts > Behaviours > [...] > [...]
Thanks !
Answer by karljj1 · Feb 26, 2015 at 08:34 PM
Use the AddComponentMenu attribute:
[AddComponentMenu( "My Scripts/Are/Now/Nested" )]
public class MyClass : MonoBehaviour {
Your answer
![](https://koobas.hobune.stream/wayback/20220613184400im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
How to make builtin Component Inspector Settings available on Custom Component? 0 Answers
Custom Inspector, Access built-in component icons? 2 Answers
Components added programatically - visibility in inspector 1 Answer
How can I hide a MonoBehaviour from the Inspector? (or make it extremely thin or compact) 1 Answer