Esempio n. 1
0
        public static List <ModelInfo> GetModelInfoByDirectory(string dir)
        {
            List <ModelInfo> modelInfoList = new List <ModelInfo>();
            List <string>    list          = new List <string>();

            EditorPath.ScanDirectoryFile(dir, true, list);
            for (int i = 0; i < list.Count; ++i)
            {
                string    assetPath = EditorPath.FormatAssetPath(list[i]);
                ModelInfo modelInfo = CreateModelInfo(assetPath);
                if (modelInfo != null)
                {
                    modelInfoList.Add(modelInfo);
                }
            }

            return(modelInfoList);
        }
Esempio n. 2
0
        public static List <TextureInfo> GetTextureInfoByDirectory(string dir)
        {
            List <TextureInfo> texInfoList = new List <TextureInfo>();
            List <string>      list        = new List <string>();

            EditorPath.ScanDirectoryFile(dir, true, list);
            for (int i = 0; i < list.Count; ++i)
            {
                string assetPath = EditorPath.FormatAssetPath(list[i]);
                string name      = System.IO.Path.GetFileName(assetPath);
                EditorUtility.DisplayProgressBar("获取贴图数据", name, (i * 1.0f) / list.Count);
                TextureInfo texInfo = CreateTextureInfo(assetPath);
                if (texInfo != null)
                {
                    texInfoList.Add(texInfo);
                }
            }
            EditorUtility.ClearProgressBar();
            return(texInfoList);
        }