-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add custom icons to unity atoms assets #23
Comments
I think I hear what you're saying, although I think there might be a bit of confusion between Gizmos which are intended for visual debugging and setup in the Scene View versus overriding the default This is pretty easy to setup. Given the number of distinct |
Got you! Was a little bit lazy and didn't do enough research before making the issue (just wanted to create it to keep track of it). Changed the name of the issue sto make it less confusing. A spreadsheet / table sounds like a good idea 👌My first initial thought is to create an icon per type, Variable, Event, Listeners, MonoHooks, Functions and Actions. How does that sound to you? Wouldn't mind if you start on a table. Another suggestion would be to use the icon that I used for my blog post here (first picture). Then we could just change the color for each type. But again, would like some input on this. |
@jeffcampbellmakesgames How do you add custom icons to scripts / assets? From looking at your repo it seems like meta data is pointing to the guid of the icon. However, do you need to manually set this guid in the meta file(s) manually or is there some other way? |
You can either add that yaml section manually through the meta file or finding the script in the Unity Editor and manually assigning it through the inspector. In the screenshot below, selecting the script's icon in the inspector and then selecting |
You can create a folder "Gizmos" and in there an image: Assets of this class type should automatically use this icon edit: reading further in this thread, it seems in newer versions you need to take the namespace into account, see this post: https://forum.unity.com/threads/custom-scriptableobject-icons-thumbnail.256246/#post-3654346 |
Just to help clarify, Gizmos are for in-sceneview icons while the types of icons these would be for would be on the ScriptableObjects in the project view or wherever they are assigned as a serialized reference. This reply goes into more detail. |
I opened the unity atoms project. Created a file at and as you can see in this image: it obviosly works for assets created from scriptable objects. its not in the scene view, it does not have to be manually assigned That said, you can't change the icon of a scriptable object asset like your picture shows. this only works for scripts. but doing a bit of research, and I think it should be clarified: (since ~Unity 2017) if you assign an icon to the a script (like in your image shown) it will propagate this item to all instances of this script, and thus also to scriptable object assets of that scripts type. |
Thanks @jeffcampbellmakesgames and @soraphis for the input! Implemented a solution in cb6280a and bcdb8f1. I actually ended up doing something a bit more complicated, but more robust when it comes to assigning icons to generated atoms (using the Generator.cs). I took some inspiration from this post on StackOverflow and did some adjustments to make it more flexible and general. It uses AssetPostprocessor to assign icons after assets are imported. Will probably break this out into its own repo, since I think that others could find it pretty nifty. Think we are good for know if comes to the icons. Might come back to this later, but closing the issue for now. |
Wouldn't this library be soooo much better with gizmos? :D
Investigate if it is possible to just use one image / icon and use it for all script icons in the inspector and all unity atom assets created (like the Post Processing Stack is doing - https://github.com/Unity-Technologies/PostProcessing)
The text was updated successfully, but these errors were encountered: