Esempio n. 1
0
        public void Update()
        {
            for (int fast = 0; fast < 10; fast++)
            {
                if (isPermission && files != null)
                {
                    if (index < files.Length)
                    {
                        var assetPath = BuildUtils.GetUnityPath(files[index]);

                        var denpendenctList = new DependenctList();

                        denpendenctList.dependencies = BuildUtils.ExceptScriptAndDll(BuildUtils.GetDependencies(assetPath));

                        denpendenctList.isdirty = false;

                        data.data.Add(assetPath, denpendenctList);

                        EditorUtility.DisplayProgressBar("正在生成资源依赖图", "进度:" + (index / (float)files.Length) * 100 + "%", ++index / (float)files.Length);
                    }
                    else
                    {
                        Debug.Log(data.data.Count + "HashCode:::" + data.data.GetHashCode());

                        isPermission = false;

                        EditorUtility.ClearProgressBar();

                        BuildUtils.RemoveAsset(EditorGenerate);

                        BuildUtils.SaveAsset(data, EditorGenerate);

                        EditorPrefs.SetBool(ResourceDirty, true);

                        data = null;
                    }
                }
            }
        }
Esempio n. 2
0
        /// <summary>
        /// 获取当前所有的资源引用数据
        /// </summary>
        /// <returns></returns>
        static AssetsDependenctData GetAssetDependenctData()
        {
            var allFile = GetAllFile();

            AssetsDependenctData data = ScriptableObject.CreateInstance <AssetsDependenctData>();

            data.data = new AssetsDependenct();

            for (int i = 0; i < allFile.Length; i++)
            {
                var assetPath = BuildUtils.GetUnityPath(allFile[i]);

                var list = new DependenctList();

                list.dependencies = BuildUtils.ExceptScriptAndDll(BuildUtils.GetDependencies(assetPath));

                list.isdirty = false;

                data.data.Add(assetPath, list);
            }

            return(data);
        }