PrefabDataCleaner

Author: Fredrik Ludvigsen (Steinbitglis)

Description
Adds a prefab data cleaner window under Window/Prefab data cleaner.



Usage

 * Place the scripts in a folder named Editor in your project's Assets folder.
 * Open the window by selecting Window/Prefab data cleaner.

What it does
The tl;dr:
 * Finds prefab instance data that isn't likely being used
 * Lets you choose which data to clean out

This window will open and analyze all the scenes that you currently have open, before showing you which prefabs may contain outdated data that you might choose to clean out.

Optionally, the window can also search your scenes for links to prefabs that have either nested prefabs or that are variants of other prefabs, since these may contain prefab instance data too.

Prefab instance data
Unity will serialize data fields if, in general, the fields are simple and public. But when you change your scripts during the course of a project lifetime, fields usually get renamed or removed altogether. Unity will then no longer serialize that data, as can be expected.

However.

When data lives in a prefab instance, it will be kept around forever.

(issues, 1191638 and 1191643)

https://forum.unity.com/threads/m_modification-doesnt-clear-old-references-when-the-prefab-is-modified.761219/#post-5069048

Currently, due to a bug, linked objects will also be pulled into builds and asset bundles.

Prefab data cleaner can be used to cherry pick that data out of your prefab instances.