• GameFramework:打包资源,上传资源至服务器,下载资源


    打包配置

    在这里插入图片描述

    左边为ab包,中间为ab包中内容,右边为项目中资源文件
    点击save,SaveConfiguration,保存打包关系到ResourceCollection.xml中
    是否使用文件系统,只能在xml中手动配置,代表下载完后会把几个零散的ab文件合成一个文件
    在这里插入图片描述

    打AB包

    在这里插入图片描述

    1. 可以选择项目中的压缩格式,默认的是GZip
    2. 每次打包资源版本号会自增1
    3. 打包输出路径不能为项目里Assets/StreamingAssets目录,应该在assets目录外打包
      代码中调用ResourceBuilderController.BuildResources

    上传AB包到服务器文件夹

    复制文件过去
    在这里插入图片描述

    服务器中创建Version.txt文件

    填充内容在打包报告中找
    在这里插入图片描述

    找到这行,把里面内容填充到Version.txt
    在这里插入图片描述

    Version.txt填充为

    {
    	"ForceUpdateGame": false,
    	"LatestGameVersion": "0.1.0",
    	"InternalGameVersion": 0,
    	"InternalResourceVersion": 2,
    	"UpdatePrefixUri": "http://10.12.24.82:10089/Windows",
    	"VersionListLength": 7138,
    	"VersionListHashCode": -1969978894,
    	"VersionListCompressedLength": 2653,
    	"VersionListCompressedHashCode": 861209557
    }
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11

    出现负数不影响使用,为crc32码转为int出现的负数

    Unity使用真实ab与更新模式

    在这里插入图片描述
    在这里插入图片描述

    远程地址修改

    在这里插入图片描述

    改为服务器地址,格式如下
    {
    “GameVersion”: “0.1.0”,
    “InternalGameVersion”: 0,
    “CheckVersionUrl”: “http://10.12.24.82:10089/{0}/Version.txt”,
    “WindowsAppUrl”: “https://starforce.gameframework.cn”,
    “MacOSAppUrl”: “https://starforce.gameframework.cn”,
    “IOSAppUrl”: “https://starforce.gameframework.cn”,
    “AndroidAppUrl”: “https://starforce.gameframework.cn”,
    “END_OF_JSON”: “”
    }

    运行下载

    在这里插入图片描述

    下载完的文件夹可以通过这个打开
    在这里插入图片描述

  • 相关阅读:
    知识图谱:架构
    AI+软件工程:10倍提效!用ChatGPT编写系统功能文档
    tensor和numpy相互转换
    信息系统项目管理师核心考点(六十四)信息安全基础知识重要概念
    WPF 键盘事件捕获
    11. [containerd] content服务解析
    MQTT异常掉线原因
    拓扑排序:acwing 848. 有向图的拓扑序列
    Spring如何控制Bean的加载顺序
    vxe-table 列表过滤踩坑_vxe-table筛选
  • 原文地址:https://blog.csdn.net/luoyikun/article/details/125628986