private static void ProcessAssetBundleRes(ResDatas table)
        {
            AssetDataGroup group = null;


            AssetDatabase.RemoveUnusedAssetBundleNames();

            string[] abNames = AssetDatabase.GetAllAssetBundleNames();
            if (abNames != null && abNames.Length > 0)
            {
                foreach (var abName in abNames)
                {
                    var depends = AssetDatabase.GetAssetBundleDependencies(abName, false);
                    var abIndex = table.AddAssetBundleName(abName, depends, out @group);
                    if (abIndex < 0)
                    {
                        continue;
                    }

                    var assets = AssetDatabase.GetAssetPathsFromAssetBundle(abName);
                    foreach (var cell in assets)
                    {
                        @group.AddAssetData(cell.EndsWith(".unity")
                            ? new AssetData(AssetPath2Name(cell), ResType.ABScene, abIndex, abName)
                            : new AssetData(AssetPath2Name(cell), ResType.ABAsset, abIndex, abName));
                    }
                }
            }
        }
Exemplo n.º 2
0
        public ResDatas BuildEditorDataTable()
        {
            Log.I("Start BuildAssetDataTable!");
            var resDatas = new ResDatas();

            AddABInfo2ResDatas(resDatas);
            return(resDatas);
        }
        public static ResDatas BuildDataTable()
        {
            Log.I("Start BuildAssetDataTable!");
            var resDatas = ResDatas.Create();

            ProcessAssetBundleRes(resDatas);
            return(resDatas);
        }
Exemplo n.º 4
0
        public static void BuildDataTable()
        {
            //Log.I("Start BuildAssetDataTable!");
            ResDatas table = new ResDatas();

            EditorRuntimeAssetDataCollector.AddABInfo2ResDatas(table);

            var filePath =
                (FilePath.StreamingAssetsPath + ResKitUtil.RELATIVE_AB_ROOT_FOLDER).CreateDirIfNotExists() +
                table.FileName;

            table.Save(filePath);
            AssetDatabase.Refresh();
        }
Exemplo n.º 5
0
        public static void BuildDataTable(string[] abNames = null, string outputPath = null)
        {
            Log.I("Start Default BuildAssetDataTable!");
            var table = new ResDatas();

            ConfigFileUtility.AddABInfo2ResDatas(table, abNames);

            var filePath =
                (outputPath ?? (AssetBundlePathHelper.StreamingAssetsPath + AssetBundleSettings.RELATIVE_AB_ROOT_FOLDER)).CreateDirIfNotExists() +
                ResDatas.FileName;

            table.Save(filePath);
            AssetDatabase.Refresh();
        }
        public static void BuildDataTable()
        {
            Log.I("Start BuildAssetDataTable!");
            ResDatas table = ResDatas.Create();

            ProcessAssetBundleRes(table);

            var filePath =
                (FilePath.StreamingAssetsPath + QFrameworkSettingData.RELATIVE_AB_ROOT_FOLDER).CreateDirIfNotExists() +
                QFrameworkSettingData.EXPORT_ASSETBUNDLE_CONFIG_FILENAME;

            table.Save(filePath);
            AssetDatabase.Refresh();
        }
        public static void BuildDataTable()
        {
            Log.I("Start BuildAssetDataTable!");
            ResDatas table = new ResDatas();

            FromUnityToDll.Setting.AddABInfo2ResDatas(table);

            var filePath =
                (FromUnityToDll.Setting.StreamingAssetsPath + AssetBundleSettings.RELATIVE_AB_ROOT_FOLDER).CreateDirIfNotExists() +
                table.FileName;

            table.Save(filePath);
            AssetDatabase.Refresh();
        }