Skip to content

Finds all missing references in your project. Reads contents of assets to detect whether GUIDs they contain exist within the project.

License

Notifications You must be signed in to change notification settings

AlexeyPerov/Unity-MissingReferences-Hunter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Missing References Hunter Unity3D Tool unity

stability-stable License: MIT Maintenance

This tool detects missing references in your assets.

All code combined into one script for easier portability. So you can just copy-paste MissingReferencesHunter.cs to your project in any Editor folder.

How it works

At first, it collects all your project GUIDs and forms a map of them.

Then it reads the contents off all GameObjects, ScriptableObjects and Scenes to gather GUIDs they contain.

Then it simply checks whether these GUIDs are present in the map from the first step.

It also checks whether GameObjects, ScriptableObjects and Scenes contain local references (e.g. fileID) to non existing parts of itself. All occurrences of {fileID: 0} are also treated as warning because they might be forgotten references.

The whole process might take few minutes for huge projects.

To list all missing references in your project...

..click on "Tools/Missing References Hunter" option which will open the window.

Press "Run Analysis" button to run the analysis (can take several minutes depending on the size of your project).

plot

Working with results

  • [Missing FileID and Guid] - in 100% of cases indicates an error like on the screenshot below plot

  • [Missing Guid] - most likely indicates an error. Sometimes missing GUID can be compensated by FileID so we are not 100% that there is a problem. However the tool still marks it as a warning for you to investigate

  • Other FileID issues most likely do not indicate errors and are hidden by default

How it works

Unity uses FileID and GUID entities to identify and assign assets to each other

This tool scans all assets to find all FileIDs and / or GUIDs that are assigned to a field but do not exist neither in current asset nor in all project

There are several types of issues that might occur during this analysis

  • [Missing FileID and Guid] - both identifiers do not exist

in that case we are 100% sure that there is a missing reference so we mark it with red color

  • [Missing Guid] - only Guid does not exist
  • [Missing FileId] - only FileId does not exist

this issues need further investigation by you because there might be or not a missing reference since it can be somehow processed by some internal Unity code

[Missing FileId] usually involves more internal nuances and less likely indicates an error and so we mark it as non-warning (cyan)

however [Missing Guid] most of the times indicates that there are some errors so we mark it as yellow

In most cases you just need to fix [Missing FileID and Guid] and [Missing Guid] issues

That is why other filters are hidden by default and most of the users won't need them

  • please also note that not all missing references are presented in Unity inspector

  • some of them might be hidden if current serialization doesn't cover fields that contain errors

  • or some of them might be replaced by custom inspectors etc

  • so in some cases you need to enable Debug inspector view or even dive into the asset file text contents

This tool also collects some other info:

  • [Missing Local FileID] - might indicate that there is some issue with internal objects referencing each other
  • [Empty Local FileID] - might indicate an empty internal field

these two fields provide some very specific info that is rarely needed for most of users

Installation

  1. Just copy and paste file MissingReferencesHunter.cs inside Editor folder
  2. [WIP] via Unity's Package Manager

Contributions

Feel free to report bugs, request new features or to contribute to this project!

Other tools

Dependencies Hunter
Textures Hunter
Editor Coroutines

About

Finds all missing references in your project. Reads contents of assets to detect whether GUIDs they contain exist within the project.

Topics

Resources

License

Stars

Watchers

Forks

Contributors 3

  •  
  •  
  •  

Languages