Hello Guest

Author Topic: Detect unused sprites in sprite collections project wide  (Read 4408 times)

lukasz.hacura

  • 2D Toolkit
  • Newbie
  • *
  • Posts: 3
    • View Profile
Detect unused sprites in sprite collections project wide
« 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?

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: Detect unused sprites in sprite collections project wide
« Reply #1 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.