public ProjectValidatorCache() { _validators = new List <BaseProjectValidator>(); // Make sure any overriden disabled types are not included var overrideConfig = AssetValidatorOverrideConfig.FindOrCreate(); // Get and add all field validators, excluding override disabled ones. var pvs = ReflectionUtility.GetAllDerivedInstancesOfTypeWithAttribute <BaseProjectValidator, ValidatorTargetAttribute>().ToArray(); for (var index = 0; index < pvs.Length; index++) { AssetValidatorOverrideConfig.OverrideItem item = null; var projectValidator = pvs[index]; if (overrideConfig.TryGetOverrideConfigItem(projectValidator.GetType(), out item)) { if (item.enabled) { _validators.Add(projectValidator); } } else { _validators.Add(projectValidator); } } }
public CrossSceneValidatorCache() { var validators = ReflectionUtility.GetAllDerivedInstancesOfType <BaseCrossSceneValidator>().ToArray(); _validators = new List <BaseCrossSceneValidator>(); // Make sure any overriden disabled types are not included var overrideConfig = AssetValidatorOverrideConfig.FindOrCreate(); for (var index = 0; index < validators.Length; index++) { AssetValidatorOverrideConfig.OverrideItem item = null; var baseCrossSceneValidator = validators[index]; if (overrideConfig.TryGetOverrideConfigItem(baseCrossSceneValidator.GetType(), out item)) { if (item.enabled) { _validators.Add(baseCrossSceneValidator); } } else { _validators.Add(baseCrossSceneValidator); } } }
public InstanceValidatorCache() { _validators = new List <AbstractInstanceValidator>(); // Make sure any overriden disabled types are not included var overrideConfig = AssetValidatorOverrideConfig.FindOrCreate(); // Get and add all field validators, excluding override disabled ones. var fieldValidators = ReflectionUtility.GetAllDerivedInstancesOfType <BaseFieldValidator>().ToArray(); for (var index = 0; index < fieldValidators.Length; index++) { AssetValidatorOverrideConfig.OverrideItem item = null; var vFieldValidator = fieldValidators[index]; if (overrideConfig.TryGetOverrideConfigItem(vFieldValidator.GetType(), out item)) { if (item.enabled) { _validators.Add(vFieldValidator); } } else { _validators.Add(vFieldValidator); } } // Get and add all object validators, excluding override disabled ones. var objectValidators = ReflectionUtility.GetAllDerivedInstancesOfType <BaseObjectValidator>().ToArray(); for (var index = 0; index < objectValidators.Length; index++) { AssetValidatorOverrideConfig.OverrideItem item = null; var vObjectValidator = objectValidators[index]; if (overrideConfig.TryGetOverrideConfigItem(vObjectValidator.GetType(), out item)) { if (item.enabled) { _validators.Add(vObjectValidator); } } else { _validators.Add(vObjectValidator); } } }