Пример #1
0
    /// <summary>
    /// 检查资源是否可以更新
    /// </summary>
    /// <param name="_isUpdate">0为不更新,1为更新</param>
    void CheckUpdateAssets(string _isUpdate)
    {
        isUpdate = _isUpdate != "0";
        if (isUpdate)
        {
            // 版本需要做热更,请求资源服务器地址
            string tempNetworkPath    = VersionConst.ToServerPath(VersionConst.AssetsUrl);
            string tempPlatformNumber = GetFileNumber_String(VersionConst.OutPlatformNumberFile);
            StartCoroutine(LoadWWW(tempNetworkPath, "platformAssets", tempPlatformNumber, OnServerPath_Callback));
            return;
        }

        // 版本不需要做热更,直接返回完成事件
        Events.msInst.DispatchEvent(VersionEvent.DOWNLOAD_COMPLETION, null);
    }
Пример #2
0
    /// <summary>
    /// 加载必要文件到本地目录
    /// </summary>
    IEnumerator LoadAllFile()
    {
        if (!File.Exists(VersionConst.OutPlatformNumberFile))
        {
            yield return(LoadFile(VersionConst.InPlatformNumberFile, VersionConst.OutPlatformNumberFile));
        }

        if (!File.Exists(VersionConst.OutVersionNumberFile))
        {
            yield return(LoadFile(VersionConst.InVersionNumberFile, VersionConst.OutVersionNumberFile));
        }

        string tempNetworkPath    = VersionConst.ToServerPath(VersionConst.UpdateAssets);
        string tempPlatformNumber = GetFileNumber_String(VersionConst.OutPlatformNumberFile);

        StartCoroutine(LoadWWW(tempNetworkPath, "platformNum", tempPlatformNumber, CheckUpdateAssets));
    }