Search Unity

Local Package Icons Not Working

Discussion in 'Package Manager' started by JakHussain, Mar 19, 2019.

  1. JakHussain

    JakHussain

    Joined:
    Oct 20, 2016
    Posts:
    318
    I have a local package with some scripts that help create a bunch of scriptable object types. Each script has an icon associated to them so that the scriptable objects can have the same asset icon when created. The same is true for any monobehaviours. The icons themselves are kept under an editor folder since i don't want them included in any builds.

    The issue is that when sending the package to someone else, the icons simply don't appear when imported. But they appear just fine if anyone opens the original Unity project where the package was developed.

    Is this a bug or will the package manager eventually support this? I saw packages like the post processing stack and cinemachine use their own icons so i thought this would just work out of the box.
     
  2. jasons_unity

    jasons_unity

    Unity Technologies

    Joined:
    Dec 10, 2018
    Posts:
    17
    One way to do this would be :
    1. Drag your package that contains your icons to your project's Assets folder.
    2. Use the Editor's import settings Inspector to click on the scripts icon and select a new icon from you package icons
    3. Drag your package back into your project's packages.

    Using the Inspector is an easy interface but this moving of your package workaround is required because Inspector cannot see icons not in the Assets folder. As far as I know, the link to your icon will remain once the package is moved.

    Let me know,
    Jason
     
    Mikulski likes this.
  3. JakHussain

    JakHussain

    Joined:
    Oct 20, 2016
    Posts:
    318
    wow that's surprising i didn't think it would be so manual. So how do Unity's own packages maintain icon links like in cinemachine? just out of curiosity.
     
  4. jasons_unity

    jasons_unity

    Unity Technologies

    Joined:
    Dec 10, 2018
    Posts:
    17
    Yes, it is definitely not optimal. The instructions above were suggested by a dev from cinemachine. My assumption is that doing it through the Editor's interface in this way would alleviated having to keep track of asset GUIDs and manually updating meta files but I am not that familiar with how icons are tracked by scripts.