Beispiel #1
0
 /// <summary>
 /// 设置资源加载方式
 /// </summary>
 void SetResourceLoadType(bool useCache)
 {
     if (UseAssetsBundle)
     {
         HotUpdateManager.CheckLocalVersion();
         ResourceManager.Initialize(AssetsLoadType.AssetBundle, useCache);
     }
     else
     {
         ResourceManager.Initialize(AssetsLoadType.Resources, useCache);
     }
 }
Beispiel #2
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);
            }
        }
    }
Beispiel #3
0
        // Use this for initialization
        void Start()
        {
#if RELEASE
            m_manager = HotUpdateManager.GetInstance();
            m_manager.Initialize();
            m_manager.downloadCompletedHandler = () =>
            {
                UnityEngine.Debug.Log("success");
                m_manager.CombineAsset();
            };
            m_manager.needDownloadHandler = (length) =>
            {
                UnityEngine.Debug.Log(length);
                m_manager.Download();
            };
            m_manager.uncompressProgressHandler = (progress) =>
            {
                UnityEngine.Debug.Log(progress);
            };
            m_manager.downloadProgressHandler = (progress) =>
            {
                UnityEngine.Debug.Log(progress);
            };
            m_manager.remoteVersionNetworkErrorHandler = (err) =>
            {
                UnityEngine.Debug.LogError(err);
            };
            m_manager.remoteChangeInfoNetworkErrorHandler = (err) =>
            {
                UnityEngine.Debug.LogError(err);
            };
            m_manager.remoteDownloadNetworkErrorHandler = () =>
            {
                UnityEngine.Debug.LogError("download error");
            };
            m_manager.remoteRootInfoNetworkErrorHandler = (err) =>
            {
                UnityEngine.Debug.LogError(err);
            };
            m_manager.combineProgressHandler = (progress) =>
            {
                UnityEngine.Debug.Log(progress);
            };
            m_manager.combineCompleteHandler = () =>
            {
                UnityEngine.Debug.Log("combine success");
            };
            m_manager.CheckVersion();
#endif
        }
    public override void OnEnterStatus()
    {
        SDKManager.Init();
        //SDKManager.LoadAD(ADType.Banner);
        SDKManager.LoadAD(ADType.Interstitial);

        FavoritesService.Init();
        PoemLibrary.Init();

        LanguageManager.Init();
        GameOptionService.Init();

        SDKManager.Log("LaunchGame", null);

        m_window = UIManager.OpenUIWindow <HotUpdateWindow>();

        HotUpdateManager.StartHotUpdate(ReceviceHotUpdateProgress);
    }
Beispiel #5
0
    protected override void OnFlowStart(params object[] paras)
    {
        GameServerAreaDataGenerate gameServerArea = flowManager.GetVariable <GameServerAreaDataGenerate>(P_GameServerAreaData);

        HotUpdateManager.StartHotUpdate(gameServerArea.m_ClientHotUpdateURL, ReceviceUpdateStatus);
    }