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);
             }
         }
     }
 }
        private void ScanForAnimations()
        {
Label0:
            foreach (string pathsWithExtension in ValidatorData.GetPathsWithExtensions(ValidatorData.MODEL_EXTENSIONS, null))
            {
                List <ModelImporterClipAnimation> modelImporterClipAnimations = new List <ModelImporterClipAnimation>();
                ModelImporter atPath = (ModelImporter)AssetImporter.GetAtPath(pathsWithExtension);
                modelImporterClipAnimations.AddRange(atPath.clipAnimations);
                modelImporterClipAnimations.AddRange(atPath.defaultClipAnimations);
                HashSet <string> strs = new HashSet <string>();
                int num = 0;
                while (num < modelImporterClipAnimations.Count)
                {
                    if (strs.Add(modelImporterClipAnimations[num].name))
                    {
                        num++;
                    }
                    else
                    {
                        this.animationCheck.AddPath(pathsWithExtension);
                        goto Label0;
                    }
                }
            }
        }
예제 #3
0
        public override void Scan()
        {
            List <string> pathsWithExtensions = ValidatorData.GetPathsWithExtensions(this.extensions, this.exclusions);

            if (pathsWithExtensions.Any <string>())
            {
                this.checklistItem.AddPaths(pathsWithExtensions);
            }
        }
 private void ScanForMixamo()
 {
     foreach (string pathsWithExtension in ValidatorData.GetPathsWithExtensions(new string[] { ".fbx" }, null))
     {
         if (!ValidatorUtils.IsMixamoFbx(pathsWithExtension))
         {
             continue;
         }
         this.mixamoCheck.AddPath(pathsWithExtension);
     }
 }
예제 #5
0
 public override void Scan()
 {
     foreach (string pathsWithExtension in ValidatorData.GetPathsWithExtensions(ValidatorData.TEXTURE_EXTENSIONS, null))
     {
         Texture2D texture2D = new Texture2D(1, 1);
         texture2D.LoadImage(File.ReadAllBytes(pathsWithExtension));
         TextureImporter atPath = (TextureImporter)AssetImporter.GetAtPath(pathsWithExtension);
         if (texture2D.height <= atPath.maxTextureSize && texture2D.width <= atPath.maxTextureSize)
         {
             continue;
         }
         this.checklistItem.AddPath(pathsWithExtension);
     }
 }
예제 #6
0
        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);
        }
예제 #7
0
        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);
        }
예제 #8
0
        private void ScanForMixamo()
        {
            List <string> pathsWithExtensions = ValidatorData.GetPathsWithExtensions(new string[]
            {
                ".fbx"
            }, null);

            foreach (string text in pathsWithExtensions)
            {
                bool flag = ValidatorUtils.IsMixamoFbx(text);
                if (flag)
                {
                    this.mixamoCheck.AddPath(text);
                }
            }
        }
예제 #9
0
        public override void Scan()
        {
            List <string> pathsWithExtensions = ValidatorData.GetPathsWithExtensions(ValidatorData.TEXTURE_EXTENSIONS, null);

            foreach (string text in pathsWithExtensions)
            {
                Texture2D texture2D = new Texture2D(1, 1);
                ImageConversion.LoadImage(texture2D, File.ReadAllBytes(text));
                TextureImporter textureImporter = AssetImporter.GetAtPath(text) as TextureImporter;
                if (!(textureImporter == null))
                {
                    if (texture2D.height > textureImporter.maxTextureSize || texture2D.width > textureImporter.maxTextureSize)
                    {
                        this.checklistItem.AddPath(text);
                    }
                }
            }
        }
예제 #10
0
        private void ScanForAnimations()
        {
            List <string> pathsWithExtensions = ValidatorData.GetPathsWithExtensions(ValidatorData.MODEL_EXTENSIONS, null);

            foreach (string text in pathsWithExtensions)
            {
                List <ModelImporterClipAnimation> list = new List <ModelImporterClipAnimation>();
                ModelImporter modelImporter            = (ModelImporter)AssetImporter.GetAtPath(text);
                list.AddRange(modelImporter.clipAnimations);
                list.AddRange(modelImporter.defaultClipAnimations);
                HashSet <string> hashSet = new HashSet <string>();
                for (int i = 0; i < list.Count; i++)
                {
                    if (!hashSet.Add(list[i].name))
                    {
                        this.animationCheck.AddPath(text);
                        break;
                    }
                }
            }
        }
예제 #11
0
        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);
        }
예제 #12
0
        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);
        }