Unity Mobile Game Version check and download

74 篇文章 4 订阅

ReadMe.txt

/*
author  :   jave.lin
date    :   2018-08-17
*/

##文件说明:
 - Version.txt 
    - 位置:Assets/StreamingAssets/windows/zh_cn/assets/Version.txt
    - 内容:
        - 第一行:程序版本
        - 第二行:资源版本
    - 例如:
        - 1.0.0.1 // 程序版本
        - 2.0.0.1 // 资源版本

 - FileMD5.txt
    - 位置:Assets/StreamingAssets/windows/zh_cn/assets/FileMD5.txt
    - 每一行的内容说明:
        - [filepath1],[md5(16个字符(字节))],[size]
        - [filepath2],[md5(16个字符(字节))],[size]
    - 例如:
        - ui/login/bg.unity3d,123456789ABCEDF0,999


##测试时的数据调整:
    - 调整Unity项目中的
        Assets/StreamingAssets/windows/zh_cn/assets下的Version.txt:
        - 可以改一下程序版本号(注意要比原来的版本号大),那么在检测时就会打开下载界面
        - 可以改一下资源版本号(注意要比原来的版本号大),那么VerCheck检测更新时会提示
            可以更新,点击StartUpdate后,就会开始下载

##功能实现:
 - 下载器:
    - 可以在加载时放入FileMD5的单条记录信息,会自动比较MD5,确定是否删除并重新下载
    - 文件的断点续传(之前未下载完得,将续集上次的数据继续下载)
    - 无论下载成功还是失败,都会触发OnDone事件
        - 可查看下载任务的结果类型:
            - 未开始
            - 成功
            - 失败 HTTP_ERROR_CODE
            - MD5不对
 - 下载管理器:
    - 可多个下载器同时下载不同的任务(4~10之间就可以了,如果网卡,硬盘速度跟得上,可以设置大一些)
    - 可以设置单个资源下载失败次数的上限值,会有个标记下载失败
    - 文件下载完后的MD5校验,如果不对,将删除重新下载
 - 版本检测:
    - 检测StreamingAssetsPersistentDataPathVersion.txt、FileMD5.txt的版本信息对比
    - 如果服务器程序版本更新,将自动调整到安装包页面(url地址可配置AppInfo.cs类)
    - 如果服务器资源版本更新,将自动分析FileMD5.txt与服务器的对比,得出:
        - 文件差异类型:
            - 添加
            - 更新
            - 删除
    - 当所有的文件下载完后会有,可以判断,string Error是否不为空,而知道是否有错误
        - (检测更新,下载更新,都可以有结果枚举类型)
            - 检测结果类型:
                - 未开始
                - 需要重新下载安装包
                - 需要下载资源包
                - 不需要更新
                - 错误
            - 下载结果类型:
                - 未开始
                - 成功
                - 失败(错误)

改工程是:https://blog.csdn.net/linjf520/article/details/80418523之后的一个升级版本
流程上和原来的不太一样,懒得去画了。。。。

Source:VersionCheck(u3d2017,vs2017,.net 4.6)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Unity 2017 2D Game Development Projects: Create three interactive and engaging 2D games with Unity 2017 Build classic arcade, shooter and platform games with Unity 2D toolset 2D games are everywhere! Timeless and popular, 2D games represent a substantial segment of the games market. The Unity engine has revolutionized the gaming industry, by making it easier for game developers to create quality games on a budget. If you are looking for a guide to create 2D games using Unity 2017, look no further. With this book, you will learn all the essentials of 2D game development by creating three epic games in a step-by-step manner throughout the course of this book. The first game will have you collecting as many cakes as possible. The second will transport you to outer space to traverse as far as possible while avoiding enemy spaceships. The last game will have you running and jumping across platforms to collect coins and other exotic items. Throughout all these three games, you will create characters, make them move, and create some enemies. And then, of course, write code to destroy them!. After showing you the necessities of creating a game, this book will then help you to porting the game to a mobile platform, and provide a path to publish it on the stores. By the end of this book, you will not only have created three complete great games, but be able to apply your knowledge to create and deploy your own games. What You Will Learn Work with Unity 2017’s new 2D workflow and create a 2D scene Set the scene with different types of backgrounds, either static or dynamically using a tileset Bring your character to life through simple animations Understand the core concepts of programming by creating basic code that controls a character and destroys an enemy Create buttons and game controls by using code snippets for input detection Develop three 2D games from genres such as classic arcade, space shooter, and platformer games Add audio and feedback and deploy your games
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值