static void UpdateDateCallBack(HotUpdateStatusEnum status, float progress)
 {
     try
     {
         s_UpdateCallBack(HotUpdateStatusInfo.GetUpdateInfo(status, progress));
     }
     catch (Exception e)
     {
         Debug.LogError("UpdateDateCallBack Error :" + e.ToString());
     }
 }
 void ReceviceHotUpdateProgress(HotUpdateStatusInfo info)
 {
     if (info.m_loadState.isDone)
     {
         ApplicationStatusManager.EnterStatus <MainMenuState>();
     }
     else
     {
         m_window.HotUpdate(info);
     }
 }
Exemple #3
0
    private void GetHotUpdatePath(List <HotUpdatePathData> datas, string error)
    {
        if (!string.IsNullOrEmpty(error))
        {
            Finish("Download HotUpdatePathData failed :" + error);
            return;
        }
        else
        {
            string channel = SDKManager.GetProperties(SDKInterfaceDefine.PropertiesKey_ChannelName, "GameCenter");

            Debug.Log("Download HotUpdatePathData count:" + datas.Count);
            HotUpdatePathData pathData = null;
            foreach (var d in datas)
            {
                if (d.m_key == channel)
                {
                    pathData = d;
                    break;
                }
            }

            if (pathData == null)
            {
                Finish("No Channel in HotUpdatePathData Channel:" + channel);
                return;
            }
            string m_HotupdatePath = pathData.m_HotupdatePath;
            string testPath        = PlayerPrefs.GetString(P_SelectHotUpdateTestPath, "");
            if (!string.IsNullOrEmpty(testPath))
            {
                //使用测试地址
                m_HotupdatePath = testPath;
            }
            Debug.Log("Start hotUpdate in Channel:" + channel + "\nPath:" + m_HotupdatePath);

            if (ApplicationManager.Instance.UseAssetsBundle)
            {
                HotUpdateManager.StartHotUpdate(m_HotupdatePath, ReceviceUpdateStatus);
            }
            else
            {
                HotUpdateStatusInfo info = new HotUpdateStatusInfo();
                info.m_status             = HotUpdateStatusEnum.NoUpdate;
                info.m_loadState          = new LoadState();
                info.m_loadState.isDone   = true;
                info.m_loadState.progress = 1f;
                ReceviceUpdateStatus(info);
            }
        }
    }
Exemple #4
0
    private void ReceviceUpdateStatus(HotUpdateStatusInfo info)
    {
        if (OnHotUpdateStatus != null)
        {
            OnHotUpdateStatus(info);
        }

        if (info.m_status == HotUpdateStatusEnum.NoUpdate || info.m_status == HotUpdateStatusEnum.UpdateSuccess)
        {
            Finish(null);
        }
        else if (info.m_status == HotUpdateStatusEnum.Md5FileDownLoadFail || info.m_status == HotUpdateStatusEnum.UpdateFail || info.m_status == HotUpdateStatusEnum.VersionFileDownLoadFail)
        {
            Finish("error:update failed! " + info.m_status);
        }
    }
 public void HotUpdate(HotUpdateStatusInfo state)
 {
     GetSlider("Slider").value = state.m_loadState.progress;
     SetText("Text_Update", LanguageManager.GetContent("HotUpdate", state.m_status.ToString()));
 }