MasyoLab / UnityTools-FavoritesAsset

Unity tool, Editor extension for favoriting assets. ,アセットをお気に入り登録するエディタ拡張
MIT License
42 stars 3 forks source link

Chance of supporinng rainbow folder ? #55

Closed bale007 closed 10 months ago

bale007 commented 10 months ago

Hi MasyoLab,

Thank you for this incredible tools, it really helps me with my project development.

Just checking that is the supporting of displaying custom folder icon in your current development milestone ?

like this picture below: image

Regards, Bale007

MasyoLab commented 10 months ago

Hi Bale007,

Thank you for using this tool!

It's great to know that there is such a wonderful tool like Rainbow Folders.

While direct support for this tool is not feasible, we have added a feature that allows you to specify the icon for display.

I used the discontinued Unity3D Rainbow Folders for testing, but by extending it as shown in the example, you can enhance the display as illustrated in the image below. image

Are you using Rainbow Folders 2?

I'm not sure if RainbowFoldersSettings.Instance.GetFolderIcon is a public function in this tool, but if the icon retrieval process used in the implementation of the folder icon drawing is a public function, it can be extended.

bale007 commented 10 months ago

Hi Masyolab,

Thank you for your quick and detailed response!

Yes, I'm using Rainbow Folders 2, thank you for pointing out the icon customization feature in the latest release, I will take a look at the plugins and integrate them the way you suggested.

Regards, Bale007

bale007 commented 10 months ago

i managed to get the custom icon working by using the following code for Rainbow Folders 2, where item2 is the "small icon" for each folder.

In Rainbow Folders 2 you get to set background for each folder but i never used that feature so setting custom icon is more than enough for my case.

    private static Texture GetAssetIcon(string folderPath)
    {
        var rule = ProjectRuleset.Instance.GetRuleByPath(folderPath, true);
        if (rule == null)
        {
            return null;
        }

        return ProjectIconsStorage.GetIcons(rule.IconType).Item2;
    }
MasyoLab commented 10 months ago

It seems like the extension was successful! That's great.