// Use this for initialization void Start() { UIManager.AdaptiveUI(); GlobalConst.IS_DEVELOP = false; goLogoPanel = goLogo; UpdateVersionScript.SetLogoActive(true); labLoading = this.transform.FindChild("Update/Progress/Tips").GetComponent <UILabel>(); labCheckingTips = this.transform.FindChild("Update/UpdateCheckingTips").GetComponent <UILabel>(); labVersion = this.transform.FindChild("Update/Version").GetComponent <UILabel>(); ProgressBar = this.transform.FindChild("Update/Progress/BarBack").GetComponent <UIProgressBar>(); MessageTips.SetActive(false); int local_version = VersionUpdateManager.VersionTag; if (local_version != 0) { GlobalConst.RES_VERSION = VersionUpdateManager.VersionIntToStr(local_version); } this.ChangeVersionLabel(VersionUpdateManager.VersionStrToInt(GlobalConst.RES_VERSION)); VersionUpdateManager.Instance.onDownLoadPeracent = OnDownLoadPeracentChanged; VersionUpdateManager.Instance.onDecompressionPeracent = OnDecompressionPeracent; VersionUpdateManager.Instance.onUpdateFinished = OnUpdateFinished; VersionUpdateManager.Instance.onUpdateFaild = OnUpdateFaild; VersionUpdateManager.Instance.onUpdateTips = OnUpdateTips; VersionUpdateManager.AddUpdateCmd(UpdateCmdType.GetStreamAssetInfo); }
public void OnUpdateTips(UpdateVersionTipsScript.TipsMessageType msgType, long size) { string str = ""; switch (msgType) { case UpdateVersionTipsScript.TipsMessageType.VersionUpdateBig: str = string.Format("发现游戏大版本更新。\r\n你确认现在更新吗?"); break; case UpdateVersionTipsScript.TipsMessageType.VersionUpdateSmall: str = string.Format("发现新的更新包,共计{0}\r\n请在wifi环境下更新,土豪随意!", Downloader.GetSizeStr(size)); break; case UpdateVersionTipsScript.TipsMessageType.VersionUpdateFaild: str = string.Format("更新失败,请检查你的网络环境后重试!"); break; default: break; } UpdateVersionTipsScript.TipMessageStruct s = new UpdateVersionTipsScript.TipMessageStruct(); s.message = str; s.msgType = msgType; VersionUpdateManager.AddUpdateCmd(UpdateCmdType.UpdateMessageTips, s); }
private void OnOk(GameObject go) { Debug.Log("ok"); switch (messageType) { case TipsMessageType.VersionUpdateBig: Application.OpenURL("http://www.baidu.com"); break; case TipsMessageType.VersionUpdateSmall: VersionUpdateManager.Instance.StartUpdate(); break; case TipsMessageType.VersionUpdateFaild: VersionUpdateManager.isRetry = true; VersionUpdateManager.AddUpdateCmd(UpdateCmdType.GetStreamAssetInfo); break; default: break; } this.gameObject.SetActive(false); }
public void OnUpdateFinished(int ver) { ProgressPeracent = 0.99f; isShowUpdateCheckingTips = false; loadInfo = string.Format("正在初始化场景资源..."); VersionUpdateManager.AddUpdateCmd(UpdateCmdType.UpdateVersionFinish); }