Giter VIP home page Giter VIP logo

Comments (8)

jeffcampbellmakesgames avatar jeffcampbellmakesgames commented on May 27, 2024 1

You can create a folder "Gizmos" and in there an image: <NameOfYourClass> Icon.png
(note the space between the class name and "Icon").

Assets of this class type should automatically use this icon

source

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.
#23 (comment)

from unity-atoms.

jeffcampbellmakesgames avatar jeffcampbellmakesgames commented on May 27, 2024

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 ScriptableObject icon so that unity-atom assets are visually distinguished.

This is pretty easy to setup. Given the number of distinct ScriptableObject derived types it would probably help to create a table/spreadsheet of each of the types we want to assign an icon to. That way we can infer a semantic or general intent thats easily visualized for each one and then create/assign an icon for it.

from unity-atoms.

AdamRamberg avatar AdamRamberg commented on May 27, 2024

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.

from unity-atoms.

AdamRamberg avatar AdamRamberg commented on May 27, 2024

@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?

from unity-atoms.

jeffcampbellmakesgames avatar jeffcampbellmakesgames commented on May 27, 2024

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 Other will allow you to manually select the icon to use.

image

from unity-atoms.

soraphis avatar soraphis commented on May 27, 2024

You can create a folder "Gizmos" and in there an image: <NameOfYourClass> Icon.png
(note the space between the class name and "Icon").

Assets of this class type should automatically use this icon

source

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

from unity-atoms.

soraphis avatar soraphis commented on May 27, 2024

I opened the unity atoms project. Created a file at Assets/Gizmos/UnityAtoms/FloatVariable Icon.png

and as you can see in this image:

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.

from unity-atoms.

AdamRamberg avatar AdamRamberg commented on May 27, 2024

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.

from unity-atoms.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.