public void Run() { if (_projectAssetValidatorManager != null) { _projectAssetValidatorManager.Search(); _projectAssetValidatorManager.ValidateAll(); } while (HasScenesToSearch()) { _currentScenePath = _scenePaths[_sceneProgress]; // Only load the next scene if we are not already in it if (EditorSceneManager.GetActiveScene().path != _currentScenePath) { EditorSceneManager.OpenScene(_currentScenePath); } using (var activeSceneManager = new ActiveSceneValidatorManager(_cache, _logger)) { activeSceneManager.Search(); activeSceneManager.ValidateAll(); } if (_crossSceneValidatorManager != null) { _crossSceneValidatorManager.Search(); } ++_sceneProgress; } if (_crossSceneValidatorManager != null) { _crossSceneValidatorManager.ValidateAll(); } }
private void ContinueSceneValidation() { if (!HasScenesToSearch()) { if (_crossSceneValidatorManager == null) { return; } _runningState = RunningState.CrossSceneState; if (_crossSceneValidatorManager.ContinueValidation()) { if (AssetValidatorUtility.IsDebugging) { Debug.LogFormat("Progress: {0:P2}% for validating cross scene information", _crossSceneValidatorManager.GetProgress()); } } else { if (AssetValidatorUtility.IsDebugging) { Debug.LogFormat("CrossSceneValidatorManager has completed validating information gathered across all targeted Scene(s).", _crossSceneValidatorManager.GetProgress()); } } return; } if (_activeSceneValidatorManager == null) { _currentScenePath = _scenePaths[_sceneProgress]; // Only load the next scene if we are not already in it if (EditorSceneManager.GetActiveScene().path != _currentScenePath) { EditorSceneManager.OpenScene(_currentScenePath); } if (_activeSceneValidatorManager != null) { _activeSceneValidatorManager.Dispose(); } _activeSceneValidatorManager = new ActiveSceneValidatorManager(_cache, _logger); _activeSceneValidatorManager.Search(); if (_crossSceneValidatorManager != null) { _crossSceneValidatorManager.Search(); } } _runningState = RunningState.InstanceState; if (_activeSceneValidatorManager.ContinueValidation()) { if (AssetValidatorUtility.IsDebugging) { Debug.LogFormat("Progress: {0:P2}% for scene instance types {1}/{2}: [{3}]", _activeSceneValidatorManager.GetProgress(), _sceneProgress, _scenePaths.Count, _currentScenePath); } } else { if (AssetValidatorUtility.IsDebugging) { Debug.LogFormat("ActiveSceneValidator has completed validating Scene {0}/{1}: [{2}]", _sceneProgress, _scenePaths.Count, _currentScenePath); } _sceneProgress++; _activeSceneValidatorManager.Dispose(); _activeSceneValidatorManager = null; } }