示例#1
0
    /// <summary>
    /// 下载版本文件列表
    /// </summary>
    private void DownloadVersionFile()
    {
        allDownloadSize = 0;

        currentState = HotFix_ProjectState.DownloadVersionFile;

        var versionListServerFile = GPath.PersistentAssetsPath + serverVersion.ToString() + ".txt";

        if (File.Exists(versionListServerFile))
        {
            File.Delete(versionListServerFile);
        }

        var versionListUnit = new DownloadUnit()
        {
            Name     = serverVersion.ToString() + ".txt",
            SavePath = versionListServerFile,
            DownUrl  = GPath.CDNUrl + serverVersion.ToString() + ".txt",
        };

        versionListUnit.ErrorFun = (DownloadUnit downUnit, string msg) =>
        {
            Debug.LogWarning("CompareVersion Download Error " + msg + "\n" + downUnit.DownUrl);
            downloadMgr.DeleteDownload(versionListUnit);
            UpdateError();
        };

        versionListUnit.CompleteFun = (DownloadUnit downUnit) =>
        {
            if (!File.Exists(versionListServerFile)) // 文件不存在,重新下载
            {
                UpdateError();
                return;
            }

            fileVersionMgr.InitVersionFile(versionListServerFile);

            var updateList = fileVersionMgr.FindUpdateFiles(clientVersion.Version);

            allDownloadSize = fileVersionMgr.DownloadSize;

            Debug.Log("版本文件数量:" + updateList.Count);

            if (updateList.Count > 0)
            {
                StartDownloadList(updateList);
            }

            else
            {
                SaveVersion();
            }
        };

        downloadMgr.DownloadAsync(versionListUnit);

        Debug.Log("版本文件url:" + versionListUnit.DownUrl);
    }
示例#2
0
 /// <summary>
 /// Returns a "short" description of the application name, version, Unity environment (shown on main menu)
 /// </summary>
 public static string GetShortSystemText()
 {
     return(string.Format("{0}\n{1} {2}\nCommonCore {3} {4}\nUnity {5}",
                          GameName,
                          GameVersion, GameVersionName,
                          VersionCode.ToString(), VersionName,
                          UnityVersionName));
 }
示例#3
0
 protected VersionName CreateVersionName(VersionCode versionCode)
 {
     return(versionCode.ToString());
 }