2D Toolkit Forum

2D Toolkit => Support => Topic started by: lukasz.hacura on November 04, 2016, 10:59:56 am

Title: Detect unused sprites in sprite collections project wide
Post by: lukasz.hacura on November 04, 2016, 10:59:56 am
Hi,

I was just wondering if it's reasonable to implement an editor tool to detect unused sprites in atlases. The idea is to check every prefab which has a tk2dSprite attached to it's game object and create a cross list with sprites in atlases. Maybe this kind of tool was already implemented? Maybe there's some functionality I could use from tk2d to speed up the process? What do you think?
Title: Re: Detect unused sprites in sprite collections project wide
Post by: unikronsoftware on November 15, 2016, 11:18:27 pm
Hi there,

There isn't anything in 2D Toolkit to help, but the script should be pretty straightforward - basically you want to load all prefabs, find related objects and make lists from those.

tk2dEditorUtility.CreateIndex has some code that walks through all prefabs looking for components.