public override void Scan() { IEnumerable <string> allAssetPaths = from p in AssetDatabase.GetAllAssetPaths() where ValidatorData.PathInAssetDir(p) select p; IEnumerator <string> enumerator = allAssetPaths.GetEnumerator(); try { while (enumerator.MoveNext()) { string current = enumerator.Current; GameObject gameObject = ValidatorData.LoadAssetAtPath <GameObject>(current); if (!(gameObject != null) || !ReferenceScanner.IsMissingReference(gameObject)) { continue; } this.checklistItem.AddPath(current); } } finally { if (enumerator == null) { } enumerator.Dispose(); } }
public override void Scan() { foreach (string pathsWithExtension in ValidatorData.GetPathsWithExtensions(ValidatorData.PREFAB_EXTENSIONS, null)) { GameObject gameObject = ValidatorData.LoadAssetAtPath <GameObject>(pathsWithExtension); if (gameObject == null) { this.emptyCheck.AddPath(pathsWithExtension); } else { if (PrefabScanner.NeedsCollider(gameObject)) { this.colliderCheck.AddPath(pathsWithExtension); } if (PrefabScanner.NeedsTransformReset(gameObject)) { this.transformCheck.AddPath(pathsWithExtension); } if (PrefabScanner.IsPrefabEmpty(gameObject)) { this.emptyCheck.AddPath(pathsWithExtension); } if (PrefabScanner.HasIncorrectLODs(gameObject)) { this.lodsCheck.AddPath(pathsWithExtension); } } } }
internal static Checklist GetCheckList() { Checklist._checklist = ValidatorData.LoadAssetAtPath <Checklist>(ValidatorData.MANAGER_PATH); if (Checklist._checklist == null) { Checklist.CreateChecklist(); } return(Checklist._checklist); }
private void ScanForOrientations() { foreach (string modelPath in ValidatorData.GetModelPaths()) { GameObject gameObject = ValidatorData.LoadAssetAtPath <GameObject>(modelPath); if (ModelScanner.IsUpright(gameObject)) { continue; } this.orientationCheck.AddPath(AssetDatabase.GetAssetPath(gameObject)); } }
private void ScanForOrientations() { List <string> modelPaths = ValidatorData.GetModelPaths(); foreach (string path in modelPaths) { GameObject gameObject = ValidatorData.LoadAssetAtPath <GameObject>(path); if (!ModelScanner.IsUpright(gameObject)) { this.orientationCheck.AddPath(AssetDatabase.GetAssetPath(gameObject)); } } }
private static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths) { Checklist checklist = ValidatorData.LoadAssetAtPath <Checklist>(ValidatorData.MANAGER_PATH); if (checklist == null) { return; } foreach (ChecklistItem checklistItem in checklist.Checks) { checklistItem.CheckAssetsForDeletion(deletedAssets); checklistItem.CheckAssetsForMove(movedFromAssetPaths, movedAssets); } }
public override void Scan() { IEnumerable <string> enumerable = from p in AssetDatabase.GetAllAssetPaths() where ValidatorData.PathInAssetDir(p) select p; foreach (string path in enumerable) { GameObject gameObject = ValidatorData.LoadAssetAtPath <GameObject>(path); if (gameObject != null && ReferenceScanner.IsMissingReference(gameObject)) { this.checklistItem.AddPath(path); } } }
public static List <string> GetModelPaths() { List <string> pathsWithExtensions = ValidatorData.GetPathsWithExtensions(ValidatorData.MODEL_EXTENSIONS, null); List <string> strs = new List <string>(); foreach (string pathsWithExtension in pathsWithExtensions) { if (!ValidatorData.GetMeshes(ValidatorData.LoadAssetAtPath <GameObject>(pathsWithExtension)).Any <Mesh>() || ValidatorData.HasAnimations(pathsWithExtension)) { continue; } strs.Add(pathsWithExtension); } return(strs); }
public static List <string> GetModelPaths() { List <string> pathsWithExtensions = ValidatorData.GetPathsWithExtensions(ValidatorData.MODEL_EXTENSIONS, null); List <string> list = new List <string>(); foreach (string text in pathsWithExtensions) { GameObject go = ValidatorData.LoadAssetAtPath <GameObject>(text); List <Mesh> meshes = ValidatorData.GetMeshes(go); if (meshes.Any <Mesh>() && !ValidatorData.HasAnimations(text)) { list.Add(text); } } return(list); }
private void ScanForPrefabs() { List <string> pathsWithExtensions = ValidatorData.GetPathsWithExtensions(ValidatorData.PREFAB_EXTENSIONS, null); HashSet <string> strs = new HashSet <string>(); foreach (string pathsWithExtension in pathsWithExtensions) { GameObject gameObject = ValidatorData.LoadAssetAtPath <GameObject>(pathsWithExtension); if (gameObject == null) { continue; } foreach (Mesh mesh in ValidatorData.GetMeshes(gameObject)) { strs.Add(AssetDatabase.GetAssetPath(mesh)); } } List <string> modelPaths = ValidatorData.GetModelPaths(); List <string> list = modelPaths.Except <string>(strs, new CustomPathComparer()).ToList <string>(); this.prefabsCheck.AddPaths(list); }
private void ScanForPrefabs() { List <string> pathsWithExtensions = ValidatorData.GetPathsWithExtensions(ValidatorData.PREFAB_EXTENSIONS, null); HashSet <string> hashSet = new HashSet <string>(); foreach (string path in pathsWithExtensions) { GameObject gameObject = ValidatorData.LoadAssetAtPath <GameObject>(path); if (gameObject != null) { List <Mesh> meshes = ValidatorData.GetMeshes(gameObject); foreach (Mesh mesh in meshes) { string assetPath = AssetDatabase.GetAssetPath(mesh); hashSet.Add(assetPath); } } } List <string> modelPaths = ValidatorData.GetModelPaths(); List <string> paths = modelPaths.Except(hashSet, new CustomPathComparer()).ToList <string>(); this.prefabsCheck.AddPaths(paths); }