How the Check Works
The CheckBrokenPrefabs
is designed to identify prefabs in your project that are missing, but still referenced within a scene or another prefab. This check operates at the GameObject level, inspecting individual GameObjects for missing prefab references.
The check performs the following steps:
- Prefab Verification: It checks if the provided GameObject is a prefab instance and has a status of
PrefabInstanceStatus.MissingAsset
. This indicates that the prefab reference is missing. - Issue Reporting: If the check identifies a missing prefab reference, it logs an issue with a description indicating the problem and references the specific GameObject that has the missing prefab reference.
When to Use This Check
- Prefab Asset Validation: To ensure that all prefab references within your scenes or other prefabs are valid and not missing.
How to Use the Check
- Configuration: No specific configuration is needed for this check.
- Perform Checks on GameObjects: Invoke the
PerformCheck(GameObject gameObject)
method and pass in the GameObject you want to examine. The check will analyze the GameObject’s prefab instance status and log an issue if it has a missing prefab reference.
Methods
- PerformCheck(GameObject gameObject): Initiates the verification process for a specific GameObject. It checks if the GameObject is a prefab instance with a missing prefab reference and logs an issue if the condition is met.
Attributes
- longDescription: Provides a description of what this check does, explaining its purpose in identifying missing prefab references within your project.