Remove unused assets
I have a project that was used to prototype multiple things and I didn't clean it while developing. Now I want to remove everything that is not used to start fresh. The problem is I can't remember what is used and what is not. It's a big project and I haven't touch i the last year.
It's now possible or I need to code something myself to do it?
Just export your scenes and Unity will include every dependency. Import them into a new project and you are done.
Like said above. Unity will ONLY include things you need, for builds and asset packs.
Good idea, but it import all the assets, even if they are used for not
I feel like the dependancy-picker has some ghosts. Take a Project with 40 scripts and a Scene using 6 of them. I can package that scene and consistantly get those 6, plus the same 12 extra scripts.
I can delete those extras, get no warnings, everything runs fine. 99% sure they aren't on a never-activated game object (and even so, the compiler would still give an error?)
I think maybe the Inspector is saving a long-since-deleted public scriptZ Z;
value. Something like that. Or could just be a UnityFree problem.
Take a look at this question: Find Unused Assets In Project
Answer by dhanrajsinh24 · Jul 23, 2015 at 12:54 PM
HI, You can select all the scenes that are used in your build and then right click and select option "Select Dependencies". It should select all the assets that are used in your current build.
But it will not select some of the plugins you have used and editor scipts etc.
So if you want to remove images, prefabs, models, then you can use that feature.
Thanks.
Answer by KristianHJ · Nov 10, 2014 at 06:41 AM
I know its an old question but I just put a tool on the asset store that does exactly this. It runs through your build log and included scenes and returns all unused assets.
(It also shows you the file size of your included assets to enable you to minimize buildsize.)
Answer by achimmihca · Jan 02, 2018 at 07:43 PM
I also wanted to clear unused assets. I created a few scripts to show (un-)used assets based on the works from https://gist.github.com/karl-/4076464 What it does is read the unity build log to find the assets that are really needed and thus also the assets that are unused. The used and unused assets that are displayed can be filtered simply by selecting a folder in the project view. Works for me using Unity 5.5.0f3.
link text [1]: /storage/temp/108422-screenshot.jpg ![alt text][1]
Answer by coolamigo · Jun 24, 2020 at 09:42 PM
Right Click the Scene (all of them selected) and export. Then import in a new project.
Answer by honor0102 · Mar 04, 2019 at 01:23 PM
late but it may help someone else
try this:
https://github.com/unity-cn/Tool-UnityAssetCleaner (download and use cleaner.unitypackage)
i also noticed that they maybe get removed automatically in build(https://gamedev.stackexchange.com/questions/119907/would-i-need-to-delete-unused-assets-from-my-unity-packaged-build)
I just tried the tool from GitHub. I unchecked assets that I wanted to keep. The last update was made in April 2016 for Unity 5.3. I'm using Unity 2017.4. The tool crashed and shut down Unity.
The provided list was a fork of the link below. It was last updated for Unity 5.6. The same thing happened when I clicked the button to remove unused assets.
https://github.com/tsubaki/UnityAssetCleaner
Great idea for its time. I guess there are some paid solutions in the Unity Asset Store.
Your answer
Follow this Question
Related Questions
OLD Unity package (Car tent with cockroach shader Salubrity) 0 Answers
When i try to imort package there is just one option is coming "custom packages..." 0 Answers
Do I need to accept the recommended project settings every time? 1 Answer
Unity re-importing small assets every time I click back into window 1 Answer
Are there any free Utility Theory assets like DecisionFlex? 0 Answers