Changing the Inspector Titlebar icon, and Text?

I've created a MonoBehaviour, and have attached it to a GameObject(mostly because I am unable to do this with just a custom Component class, opposed to the MonoBehavour class). Though if I were to create a Camera Object, I'd see that the 'Camera' Insepector TitleBar has no (Script) text next to the TypeName Text, and has its own Icon(which looks like a camera, where the MonoBehaviour component looks like a piece of paper).

Is this possible? If I'm going about it wrong, then how-so? I'd prefer to have just created a custom GameObject, though in my previous attempt I found problems rendering the DefaultGUIInspector(it looked nothing like the regular GameObjects GUI Inspector.. became annoying). Perhaps, I'm just a bit of a perfectionist, but I'm still interested in the possibilities here.

(Script) is appended to any MonoBehaviour derived class, no way to change that. Even some built-in classes (like Terrain, which is implemented as a Mono script), have it.

To change the icon, simply add a custom texture to your project with such a path: Gizmos/NewBehaviourScript Icon.png

(Only .png and .tif are accepted file formats here.)

To change the icon in the inspector, you have to change the icon in unity for your actual script file that defines the assets. For instance I have a class called CodexCard, and assets are created using CreateInstance. So if you change the icon in the inspector while inspecting the ACTUAL script class file (not the asset!) it will show up.

took me a while to figure that out :wink:

Regarding the script’s title, there is actually a way to do this. Above the class declaration, add the [AddComponentMenu("...")] decorator, e.g:

[AddComponentMenu("Special Name")]
public class MyScript : MonoBehaviour
{ ... }

This is the name that will be used when you select “Add Component” and also the name displayed in the inspector for this component when attached to a GameObject.