有关游戏进入动更机制流程的思考 (Unity)

主要流程状态

  • Init
  • LoadManifestVersion
  • CompareManifestVersion
  • LoadManifest
  • CompareManifest
  • Upgrade
  • AfterUpgrade
  • Unzip
  • AfterUnzip
  • Done

主要接口

m_AssetUpdateOp = Miaokids.Modules.ResourceDownloader.Instance.UpdateAssets (Miaokids.Utilities.Constants.updateManifestFile,
                settingManager.resourceUrl,
                false, false, true);
            yield return m_AssetUpdateOp;

Init

初始化

1 初始化下载路径

m_TemporaryPath = "/Projects/miaokidsmathpublic/miaokids/tmp/";
m_InstallPath = "/Users/tomyuan/Projects/miaokidsmathpublic/miaokids/install/"
m_ResourcePath = "/Users/tomyuan/Projects/miaokidsmathpublic/miaokids/resource/main/"
m_ManifestVersionFileName = "manifest_version/main.json"
m_ManifestFileName = "manifest/main.json"
m_DownloadUrl = "https://miaokids-xxxxxxx.aliyuncs.com/android/1.0.0/"

2 初始化参数

IgnoreCompareManifestVersion = false
KeepAlive = keepAlive;
EnablePing = enablePing;

LoadManifestVersion

m_DownloadSpeedCalculator.Reset ();

m_LoadLocalManifestVersionOp = FileManager.Instance.LoadFile (m_ManifestVersionFileName);

m_LoadRemoteManifestVersionOp = new AssetHttpDownloadOperation (m_DownloadUrl + m_ManifestVersionFileName);
m_LoadRemoteManifestVersionOp.EnableWriteFile = false;
m_LoadRemoteManifestVersionOp.RetainData = true;
m_LoadRemoteManifestVersionOp.Start ();

欢迎留言

avatar
  Subscribe  
Notify of