Beispiel #1
0
        private void GetPrefabList()
        {
            prefabList = new Dictionary <string, PrefabInfo>();
            string _progressTitle = "获取预制体";

            EditorUtility.DisplayProgressBar(_progressTitle, "", 0);
            for (int i = 0; i < prefabs.Count; ++i)
            {
                PrefabDir dir = prefabs[i];
                GetPrefabFromPath(dir);
                EditorUtility.DisplayProgressBar(_progressTitle, dir.path, (float)(i + 1) / prefabs.Count);
            }
            EditorUtility.ClearProgressBar();
        }
Beispiel #2
0
        private void GetPrefabFromPath(PrefabDir dir)
        {
            if (dir.ignore)
            {
                return;
            }
            List <string> files = FileUtils.GetFiles(dir.path, ".prefab");

            foreach (var file in files)
            {
                if (prefabList.ContainsKey(file))
                {
                    continue;
                }
                prefabList.Add(file, new PrefabInfo()
                {
                    res      = file,
                    dir      = dir,
                    refBy    = null,
                    refCount = 0,
                    depends  = null,
                });
            }
        }