Exemplo n.º 1
0
        public void AddDownloadAgentHelper(IDownloadAgentHelper downlodAgentHeler)
        {
            DownloadAgent agent = new DownloadAgent(AddDownloadAgentHelper);

            agent.DownloadAgentStart += OnDownlodAgentStart;
            m_TaskPool.AddAgent(agent);
        }
Exemplo n.º 2
0
        void AddDownloadAgentHelper(IDownloadAgentHelper downloadAgentHelper)
        {
            DownloadAgent agent = new DownloadAgent(downloadAgentHelper);
            agent.DownloadAgentStart += OnDownloadAgentStart;         
            agent.DownloadAgentUpdate += OnDownloadAgentUpdate;

            m_TaskPool.AddAgent(agent);
        }
Exemplo n.º 3
0
        /// <summary>
        /// 增加下载代理辅助器。
        /// </summary>
        /// <param name="downloadAgentHelper">要增加的下载代理辅助器。</param>
        public void AddDownloadAgentHelper(IDownloadAgentHelper downloadAgentHelper)
        {
            DownloadAgent agent = new DownloadAgent(downloadAgentHelper);
            agent.DownloadAgentStart += OnDownloadAgentStart;
            agent.DownloadAgentUpdate += OnDownloadAgentUpdate;
            agent.DownloadAgentSuccess += OnDownloadAgentSuccess;
            agent.DownloadAgentFailure += OnDownloadAgentFailure;

            m_TaskPool.AddAgent(agent);
        }
Exemplo n.º 4
0
            public DownloadAgent(IDownloadAgentHelper downloadAgentHelper)
            {
                m_Helper        = downloadAgentHelper;
                m_Task          = null;
                m_FileStream    = null;
                m_WaitFlushSize = 0;
                m_StartLength   = 0;
                m_SavedLength   = 0;
                m_Disposed      = false;

                DownloadAgentStart = null;
            }
Exemplo n.º 5
0
            public DownloadAgent(IDownloadAgentHelper downloadAgentHelper)
            {
                if (downloadAgentHelper == null)
                {
                    throw new GameFrameworkException("Download agent helper is invalid.");
                }
                m_Helper           = downloadAgentHelper;
                m_Task             = null;
                m_FileStream       = null;
                m_WaitFlushSize    = 0;
                m_WaitTime         = 0;
                m_StartLength      = 0;
                m_DownloadedLength = 0;
                m_SavedLength      = 0;
                m_Disposed         = false;

                DownloadAgentStart   = null;
                DownloadAgentUpdate  = null;
                DownloadAgentSuccess = null;
                DownloadAgentFailure = null;
            }
Exemplo n.º 6
0
        /// <summary>
        /// 初始化下载代理的新实例。
        /// </summary>
        /// <param name="downloadAgentHelper">下载代理辅助器。</param>
        public DownloadAgent(IDownloadAgentHelper downloadAgentHelper)
        {
            if (downloadAgentHelper == null)
            {
                Debug.LogError("Download agent helper is invalid.");
                return;
            }

            m_Helper           = downloadAgentHelper;
            m_Task             = null;
            m_FileStream       = null;
            m_WaitFlushSize    = 0;
            m_WaitTime         = 0f;
            m_StartLength      = 0;
            m_DownloadedLength = 0;
            m_SavedLength      = 0;
            m_Disposed         = false;

            DownloadAgentStart    = null;
            DownloadAgentUpdate   = null;
            DownloadAgentSuccess  = null;
            DownloadAgentProgress = null;
            DownloadAgentFailure  = null;
        }