public void ScanProfile(IValidationProfile profile) { EditorApplication.delayCall += () => { var results = new List <ValidationProfileResult>(); this.validationProfileTree.CleanProfile(profile); try { foreach (var result in profile.Validate(this.runner)) { this.validationProfileTree.AddResultToTree(result); results.Add(result); if (GUIHelper.DisplaySmartUpdatingCancellableProgressBar(result.Profile.Name, result.Name, result.Progress)) { break; } } } finally { EditorUtility.ClearProgressBar(); this.overview.ProfileResults = results; this.overview.Update(); this.validationProfileTree.MarkDirty(); this.validationProfileTree.UpdateMenuTree(); this.validationProfileTree.AddErrorAndWarningIcons(); } }; }
public override IEnumerable <ValidationProfileResult> Validate(ValidationRunner runner) { var partialProgress = 0f; var partialProgressStepSize = 1f / this.Profiles.Length; for (int i = 0; i < this.Profiles.Length; i++) { IValidationProfile profile = this.Profiles[i]; foreach (var result in profile.Validate(runner)) { result.Progress = result.Progress * partialProgressStepSize + partialProgress; yield return(result); } partialProgress += partialProgressStepSize; } }