- Home /
Cogwheel icon in inspector
I'm working in Unity 3.5.7f6, and I created my own script called GameManager, a standard MonoBehaviour script, added it to a object, and I noticed that I got a cog wheel as a icon for the script (on the left far left side):
Normally you get, what looks like, a white paper with a corner tucked in:
But I didn't think much about it since the script worked as it should and everything was fine while working in the editor.
But then I noticed, when I play my game as a standalone (*.exe), that the public values which I set through the inspector didn't get stored, and the values always was set to the default values. No matter how I did. Same thing when using a custom editor script and using SerializedProperty variable.
So I created a new script, with the exact same code, but with a different name (GameplayManager), and that worked as it was intended, both in editor and as a standalone. This time I didn't get the cog wheel, but the standard icon.
So my question is, what does this cog wheel mean, what does it do, and how can I remove/change the icon if I do get it? Maybe is the name (GameManager) somehow flagged in Unity to be something special. Does anyone have an idea?
Any insights on this? I can get the gear icon with a script called Game$$anonymous$$anager in 4.6. I haven't tried a build. I'm just really curious if it means anything.
Answer by Flickayy · Apr 16, 2015 at 11:55 PM
Sorry to bump an old post, but I have recently ran into this confusing issue.
From my experience, and I could be wrong or not completely right. In any case, the gear icon has always appeared (to me anyway) when I have created a ScriptableObject class.
My conclusion; Somewhere in Unity there is a ScriptableObject named GameManager, not accessible to us. This is why I believe that Unity - Writing The Game Manager has encapsulated it into a namespace, to remove any conflicts within the program itself.
I hope this helps anyone else who has encountered this issue.
I believe that is correct. The script will still work if it's not put in a separate namespace though, it's just the icon that is deter$$anonymous$$ed wrong.
Answer by dpoly · Mar 01, 2019 at 04:33 AM
This is baked into Unity, but it's a fake problem. It arises only when you put your user-written code into the global namespace. Don't do it!
The real answer is that all user-written script code should be in its own namespace -- that's what the feature is there to do. It would help if the Unity templates adopted that convention.
Your answer
Follow this Question
Related Questions
Draw specific Object Inspector into Rect 1 Answer
Way to graphically visualize a Vector2 or Vector3 in inspector? 2 Answers
Changes in Inspector have no effect 0 Answers
How Mark Prefab Dirty? 1 Answer