UnityEditor Change Script Name on Inspector

                     Changing Unity component name in Inspector does not require any editor script. This can be achieved using a simple attribute AddComponentMenu. The AddComponentMenu attribute allows you to place a script anywhere in the "Component" menu, instead of just the "Component->Scripts" menu.

You use this to organize the Component menu better, this way improving workflow when adding scripts.


Script In Inspector before

    In this script I have added a string variable and assigned a TextArea attribute to it. And the inspector named it as Collection(script). I want it to be just Collection, and want to remove (script).







Script before adding attribute


After Adding Attribute

The first args of this attribute assign the our script to any other component or own component menu instead of its default component menu, which display as script.

The second args of this attribute assign the order of the component in the component menu (smaller the number is higher to the top).





Comments