I’m creating a kindof physics extension package and I have some gizmos with it. Mine are the 2 on the bottom.
Looks great, except that this is in light mode Unity, and in modern times we like to use dark mode. So let’s switch:
But now, my icons don’t look so great anymore.
I’d like a way to have these script icons be light or dark mode specific without having to write some editor script that checks what mode Unity is on and meticulously swaps icons in the meta file. My assumption is that it would simply be an extra line in the meta file and that you can specify a light as well as a dark mode icon in the inspector.
Edit:
Nevermind, I found you can use “RigidbodyStuff icon” and “d_RigidbodyStuff Icon” in the Gizmos folder. To specify, this is what your folder structure should look like. Let’s say we have a class RigidbodyStuff inside the namespace My.Namespace
Gizmos
My
Namespace
RigidbodyStuff Icon ← Don’t forget the " Icon" afterwards.
d_RigidbodyStuff Icon
Note that this gives your scripts icons, but doesn’t actually create gizmos in the scene view. For that you should still assign an icon via the inspector.
Hi Ciro (love your work), I have a custom script that copies a ~Gizmos folder in my package to a Gizmos folder in Assets on [InitializeOnLoad]. I will send it to you when I get home later this evening
It’s an interesting solution. But this is for an Asset Store package, and I want to be as less disruptive as possible to the user. So importing files in their project just for an icon seems like a big ask. In the end, I might just keep the icon the same colour for both themes.
Oh trust me, I WISH there was a better solution. Eventually I just caved.
If you want you can probably import these files as hidden in the Gizmos? That way they won’t show up in the project window but still be seen… hopefully? Haven’t tested if that actually works, really just thought of this now from the top of my head.
And annoyingly, having icons can really help with communication of your asset, so it may be worth the tradeoff.
Ah you mean using hideFlags? Hmm. That sounds a bit wonky…
Ah, in general I’m sorted because I assign the icon manually from the Inspector of the script. The problem being, I can only assign one, can’t differentiate between dark/bright mode.