예제 #1
0
 /// <summary>
 /// 编译AssetBundle标记的名字
 /// </summary>
 /// <param name="path">路径</param>
 protected static void BuildAssetBundleName(string path)
 {
     path.Walk((file) => {
         if (!file.Name.EndsWith(".meta"))
         {
             CCreateAssetBundles.BuildFileBundleName(file, path);
         }
     });
 }
예제 #2
0
        public static void BuildAllAssetBundles()
        {
            RuntimePlatform switchPlatform = CEnv.SwitchPlatform;
            string          platform       = CEnv.PlatformToName(switchPlatform);

            CCreateAssetBundles.ClearAssetBundle();
            CCreateAssetBundles.BuildAssetBundleName(CEnv.DataPath + CEnv.ResourcesBuildPath);

            string releasePath = CEnv.DataPath + CEnv.ReleasePath + "/" + platform;

            CDirectory.CreateDir(releasePath, CDirectory.Operations.EXISTS_TO_DELETE);
            BuildPipeline.BuildAssetBundles("Assets" + CEnv.ReleasePath + "/" + platform,
                                            BuildAssetBundleOptions.None,
                                            CCreateAssetBundles.PlatformToBuildTarget(switchPlatform));

            CCreateAssetBundles.BuildListFile(releasePath);

            AssetDatabase.Refresh();
        }