Beispiel #1
0
        /// <summary>
        /// 获取所有的资源引用数据信息
        /// </summary>
        public static void UpdateAssetDependenct()
        {
            using (new ExecuteTimer("UpdateAssetDependenct"))
            {
                //获取所有的资源引用数据信息
                data = GetAssetDependenctData();

                //刷新存储资源引用数据
                BuildUtils.RemoveAsset(EditorGenerate);

                BuildUtils.SaveAsset(data, EditorGenerate);

                EditorPrefs.SetBool(ResourceDirty, true);
            }
        }
Beispiel #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);
        }