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();
            }
        }
Example #2
0
        public static List <Mesh> GetMeshes(GameObject go)
        {
            List <Mesh> list = new List <Mesh>();

            MeshFilter[]          componentsInChildren  = go.GetComponentsInChildren <MeshFilter>(true);
            SkinnedMeshRenderer[] componentsInChildren2 = go.GetComponentsInChildren <SkinnedMeshRenderer>(true);
            list.AddRange(from m in componentsInChildren
                          select m.sharedMesh);
            list.AddRange(from m in componentsInChildren2
                          select m.sharedMesh);
            return((from m in list
                    where ValidatorData.PathInAssetDir(AssetDatabase.GetAssetPath(m))
                    select m).ToList <Mesh>());
        }
Example #3
0
        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);
                }
            }
        }
Example #4
0
        internal static string ToProjectRelativePath(string path)
        {
            path = path.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar);
            string text = Application.dataPath;

            text = text.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar);
            if (path.StartsWith(text) && path.Length > text.Length)
            {
                path = path.Substring(text.Length + 1);
            }
            if (!ValidatorData.PathInAssetDir(path))
            {
                path = Path.Combine("Assets", path);
            }
            return(path);
        }
Example #5
0
        public static List <Mesh> GetMeshes(GameObject go)
        {
            List <Mesh> meshes = new List <Mesh>();

            MeshFilter[]          componentsInChildren     = go.GetComponentsInChildren <MeshFilter>(true);
            SkinnedMeshRenderer[] skinnedMeshRendererArray = go.GetComponentsInChildren <SkinnedMeshRenderer>(true);
            meshes.AddRange(
                from m in (IEnumerable <MeshFilter>) componentsInChildren
                select m.sharedMesh);
            meshes.AddRange(
                from m in (IEnumerable <SkinnedMeshRenderer>) skinnedMeshRendererArray
                select m.sharedMesh);
            meshes = (
                from m in meshes
                where ValidatorData.PathInAssetDir(AssetDatabase.GetAssetPath(m))
                select m).ToList <Mesh>();
            return(meshes);
        }