Deep Scanner Module

The Scanner is the engine responsible for traversing the Unity project structure and identifying anomalies.

Architecture

The scanner is built on MRK_Scanner.cs and operates in three distinct phases:

Phase 1: Active Scene Analysis

  • Iterates over SceneManager.GetActiveScene() and any loaded additive scenes.
  • Uses GameObject.GetComponents to check for null entries (Missing Scripts).
  • Uses SerializedObject iteration to check every property for objectReferenceValue == null where the objectReferenceInstanceIDValue != 0.

Phase 2: Background Scene Traversal

To ensure comprehensive coverage without requiring manuals actions:

  1. The scanner identifies all .unity files in the project.
  2. It uses EditorSceneManager.OpenScene(path, OpenSceneMode.Additive) to verify content.
  3. Post-scan, it ensures the scene is closed to maintain a clean workspace.

Phase 3: Asset Analysis

  • Prefabs: Loads assets via AssetDatabase.LoadAssetAtPath<GameObject> and checks recursively.
  • ScriptableObjects: Scans serialized data for configuration assets.

Performance

The scanner reports progress via EditorUtility.DisplayCancelableProgressBar. For large projects, garbage collection (Resources.UnloadUnusedAssets) is triggered periodically to prevent memory spikes during the scan.


This site uses Just the Docs, a documentation theme for Jekyll.