Location of built-in image resources

I’d like to create a script that uses some of Unity’s built-in gizmos and icons, but I’m having trouble finding the available resources. The docs for Gizmos.DrawIcon mentions the Unity.app/Contents/Resources folder as the location of “Light Gizmo.tiff”, but I see no such file. Where can I find Unity’s included GUI resources?

The supplied file path for the built-in light icon is only valid on the Mac, so if you’re using Windows, this would explain why you can’t access the file. I’m not entirely sure why that information is in the docs, since I don’t think the filenames of the built-in icons are documented anyway. However, your own icons should work if you place them in a folder called Gizmos at the top level of your project.

Thanks, I actually am on a Mac, but I think I’ve found the location of built-in gizmo images. In Unity.app/Contents/Resources there are a few large extensionless resource files which appear to contain all sorts of images and scripts crammed into one uncompressed file. I dug through “unity editor resources” with a hex editor and found a reference to Light Gizmo.

I’ve solved one part of the problem. Here’s how you get the inspector icon for a component:

Texture icon = EditorGUIUtility.ObjectContent(null, typeof(BoxCollider)).image;