private void SetupSceneValidator()
 {
     sceneValidatorState = null;
     if (EditorSceneManager.loadedSceneCount == 1)
     {
         var  scenePath      = EditorSceneManager.GetActiveScene().path;
         Type validatorClass = SceneValidatorReflectionUtility.GetValidatorFor(scenePath);
         if (validatorClass != null)
         {
             sceneValidatorState = new SceneValidatorState(validatorClass);
             windowState         = WindowState.Valid;
         }
         else
         {
             windowState = WindowState.NoValidatorForScene;
         }
     }
     else
     {
         windowState = WindowState.NotExactlyOneSceneOpen;
     }
 }
        public static void DrawValidatorItemsGUI(SceneValidatorState sceneValidatorState)
        {
            if (GUILayout.Button("Validate All", GUILayout.Height(40f)))
            {
                sceneValidatorState.ValidateAll();
            }

            var scrollControlID = GUIUtility.GetControlID(FocusType.Passive);
            var scrollState     = (ScrollState)GUIUtility.GetStateObject(typeof(ScrollState), scrollControlID);

            using (var scrollView = new GUILayout.ScrollViewScope(scrollState.scrollPosition))
            {
                scrollState.scrollPosition = scrollView.scrollPosition;
                foreach (var validationInfo in sceneValidatorState.GetValidationInfosSorted())
                {
                    if (SceneValidatorDrawing.ValidationItem(validationInfo.Result, validationInfo.Description))
                    {
                        var validatorInstance = Activator.CreateInstance(sceneValidatorState.ValidatorClass);
                        var success           = (bool)validationInfo.ValidationMethod.Invoke(validatorInstance, null);
                        validationInfo.Result = success ? ValidationResult.Success : ValidationResult.Fail;
                    }
                }
            }
        }