Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
6
Question by N1nja · Nov 19, 2009 at 08:20 AM · mono-behaviour

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.

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

3 Replies

· Add your reply
  • Sort: 
avatar image
11
Best Answer

Answer by jonas-echterhoff · Nov 19, 2009 at 10:38 AM

(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.)

Comment
Add comment · Show 10 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image LuckyLights · Jul 03, 2013 at 08:55 AM 0
Share

Works perfectly thx! But how do you changes the Icon in the inspector?

avatar image LightStriker · Sep 27, 2013 at 08:06 PM 0
Share

I'm having problem with this... Is the name "nameOfScript Icon" or "nameOfScript"? Is it Assets/Gizmos/ or the folder Gizmos can exist somewhere else?

avatar image skalev · Sep 28, 2013 at 04:13 AM 1
Share

Has to be in Assets/Gizmos file name is ClassName icon.(png/tif) That is Class Name (capitalized like your class) [space] icon.(png/tif)

avatar image LightStriker · Sep 30, 2013 at 01:09 PM 0
Share

Hmm... Doesn't work. I have a script named "Scene" and a file Assets/Gizmos/Scene icon.png and my scripts don't take the icon automatically. And why is this not documented anywhere?

avatar image SonicBloomEric · Dec 29, 2015 at 11:59 PM 1
Share

This method does not work when the $$anonymous$$onoBehaviour is in a namespace. See here for an explanation of what one user has previously attempted.

Show more comments
avatar image
7

Answer by skalev · Sep 06, 2013 at 06:26 AM

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 ;)

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by bszalapski · Jun 10, 2020 at 05:42 PM

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.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

6 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

The name 'Joystick' does not denote a valid type ('not found') 2 Answers

One of my scripts has no check-box next to it in Inspector 2 Answers

How to use intelisence in mono (in order to get all the contents of other script file) 1 Answer

How to import the object from server to unity 2 Answers

monobehaviour script accessing problem causes error 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges