Missing Scripts

Inspector Gadgets improves the Inspector for missing scripts by adding a button to easily remove the component in question as well as one to open a window that will search through all assets and scenes to find any more missing scripts. This window can also be opened from the Edit/Preferences/Inspector Gadgets window.

The Missing Script Window tries to suggest other possible alternatives for each missing script based on its name and the names and types of each of its serialized fields. Unfortunately, Unity tends to lose this data after scripts go missing so it isn't always possible to offer any suggestions.

The window itself has a Context Menu Function to Destroy All Missing Scripts which will go through all assets and scenes and remove everything with a missing script in one go.

This system has several limitations due to the way Unity handles missing scripts:

  • The only known way to actually get a reference to a missing script (and determine its name and serialized fields) is via a custom Inspector which needs each object to be selected in turn. If anyone knows of a better way to do it, please email mail@kybernetik.com.au.
  • Unlike missing components where the prefab asset still exists, other types of missing assets (such as ScriptableObjects) do not have any way for a reference to be obtained so they cannot be automatically selected in order to show its Inspector so they are shown in a separate list. Clicking on the asset path will select the asset, or you can simply use the Delete button to delete the file directly.