예제 #1
0
        private void OnResourceUpdateSuccess(object sender, CFEventArgs e)
        {
            ResourceUpdateSuccessEventArgs ne = (ResourceUpdateSuccessEventArgs)e;

            //更新记录 当前开始下载的资源的 下载大小(下载完成)
            m_LoadedLength[ne.Name] = ne.ZipLength;

            //更新当前资源下载数量
            m_CurrUpdateCount++;
        }
        /// <summary>
        /// 创建资源更新成功事件。
        /// </summary>
        /// <param name="name">资源名称。</param>
        /// <param name="downloadPath">资源下载后存放路径。</param>
        /// <param name="downloadUri">资源下载地址。</param>
        /// <param name="length">资源大小。</param>
        /// <param name="zipLength">压缩包大小。</param>
        /// <returns>创建的资源更新成功事件。</returns>
        public static ResourceUpdateSuccessEventArgs Create(string name, string downloadPath, string downloadUri, int length, int zipLength)
        {
            ResourceUpdateSuccessEventArgs resourceUpdateSuccessEventArgs = ReferencePool.Acquire <ResourceUpdateSuccessEventArgs>();

            resourceUpdateSuccessEventArgs.Name         = name;
            resourceUpdateSuccessEventArgs.DownloadPath = downloadPath;
            resourceUpdateSuccessEventArgs.DownloadUri  = downloadUri;
            resourceUpdateSuccessEventArgs.Length       = length;
            resourceUpdateSuccessEventArgs.ZipLength    = zipLength;
            return(resourceUpdateSuccessEventArgs);
        }
        private void OnResourceUpdateSuccess(object sender, GameEventArgs e)
        {
            ResourceUpdateSuccessEventArgs ne = (ResourceUpdateSuccessEventArgs)e;
            Log.Info("Update resource '{0}' success.", ne.Name);

            for (int i = 0; i < m_UpdateLengthData.Count; i++)
            {
                if (m_UpdateLengthData[i].Name == ne.Name)
                {
                    m_UpdateLengthData[i].Length = ne.ZipLength;
                    m_UpdateSuccessCount++;
                    RefreshProgress();
                    return;
                }
            }

            Log.Warning("Update resource '{0}' is invalid.", ne.Name);
        }
예제 #4
0
    private void OnResourceUpdateSuccess(object sender, GameFramework.Event.GameEventArgs e)
    {
        ResourceUpdateSuccessEventArgs evt = (ResourceUpdateSuccessEventArgs)e;

        Log.Info("更新文件{0}完成!资源大小:{1}", evt.Name, evt.Length);
    }
예제 #5
0
    private void OnResourceUpdateSuccess(object sender, GameEventArgs e)
    {
        ResourceUpdateSuccessEventArgs args = (ResourceUpdateSuccessEventArgs)e;

        Debug.Log("更新成功: " + args.Name);
    }
예제 #6
0
 private void OnResourceUpdateSuccess(object sender, IResourceUpdateSuccessEventArgs e)
 {
     EventComponent.This.Fire(this, ResourceUpdateSuccessEventArgs.Create(e));
 }