对UnityGameFramework 的 打包进行扩展 version 配置生成
-
配置UGF打包需要的配置文件 及路径
配置参考 使用 AssetBundle 编辑工具 | Game Framework 不过由于E大文档年代久远,新版本资源系统有些许不同
AssetBundleXXXX--> ResourceXXXGameFrameworkConfigs 配置UGF 资源配置文件路径
public static class GameFrameworkConfigs { [BuildSettingsConfigPath] public static string BuildSettingsConfig = GameFramework.Utility.Path.GetRegularPath(Path.Combine(Application.dataPath, "Res/Configs/BuildSettings.xml")); [ResourceCollectionConfigPath] public static string ResourceCollectionConfig = GameFramework.Utility.Path.GetRegularPath(Path.Combine(Application.dataPath, "Res/Configs/ResourceCollection.xml")); [ResourceEditorConfigPath] public static string ResourceEditorConfig = GameFramework.Utility.Path.GetRegularPath(Path.Combine(Application.dataPath, "Res/Configs/ResourceEditor.xml")); [ResourceBuilderConfigPath] public static string ResourceBuilderConfig = GameFramework.Utility.Path.GetRegularPath(Path.Combine(Application.dataPath, "Res/Configs/ResourceBuilder.xml"));
-
设置打包事件
Unity 菜单栏
Game Framework/Resource Tools/Resource BuilderBuildEventHandle设置为UGFExtensions.Build.Editor.BuildEventHandle -
配置VersionInfo部分参数
-
在
Res/Configs目录下右键 选择Create/UGFExtensions/VersionInfoEditorData创建VersionInfoEditorData -
设置VersionInfoData
- VersionInfoData配置在VersionInfo List.
- 添加VersionInfoData
Key为 Version 环境名 比如(测试服1,测试服2,正式服,xxx渠道)value为VersionInfo 其中需要配置ServerPath不同环境下 资源地址可能不一样 所以需要自己配置 ResourcesVersion是根据ApplicableGameVersion和InternalResourceVersion替换其中.为_例如1_0_1Platform是当前打包平台- 最终的
UpdatePrefixUri是根据 前面三项 合并而成 例如http://127.0.0.1/resources/1_1_1/Windows - VersionInfo 中
InternalGameVersion每次打包自增 也可以自己手动设置后 手动生成version.txt Active是当前处于激活的环境 生成时根据当前激活的配置进行生成。
-
两种生成version的模式
-
IsGenerateToFullPath设置为True 时自动将version.txt 生成到打包界面设置的FullPath下对应平台的目录
-
IsGenerateToFullPath设置为False时可以自行选择生成路径 点击生成按钮生成
-
-
-
打包
打包前如果没有配置
VersionInfoEditorData会自动生成VersionInfoEditorData. 生成位置配置在 BuildEventHandle 56行 会自动生成一个名为Normal 的VersionInfoData 可以自行修改。