Introducing Unity Sweeper - a tool to remove unused assets from your Unity project
We’re often the recipients of large Unity projects overdue for optimization or a spring cleaning. Commonly, these inherited projects are bloated with unused assets and no matter how much time we spent on cleanup, unused assets always sneaked through.
We’ve released an open-source tool called “Unity Sweeper” which detects unused files, removes them from your project, and creates a backup of the removed assets exported as a Unity package.
You can find the github repository here: https://github.com/notiontheory/unity-sweeper
Using the tool is really simple. You can initiate deleting unused files through the Window menu.
Options are:
- Only resource - Will sweep everything except scripts
- Unused by Editor - Will sweep everything used by game or editor, including scripts
- Unused by Game - Will sweep everything used by game, including scripts
- Clear cache - Deletes cache files
If you choose any of first three options, Unity Sweeper will run a search through your project, after which it will show a screen like this:
...from where you can review the unused assets found, uncheck assets which you want to keep in your project, and select the assets you want to exclude from your project. Unity Sweeper will also remove empty directories.
Clicking the Exclude from Project button will create a Unity Package with current the datetime and export the package to the location of PROJECT_ROOT/BackupUnusedAssets.
Happy unused asset hunting!