/// <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); } }); }
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(); }