/// <summary> /// 创建 Web 请求代理辅助器错误事件。 /// </summary> /// <param name="errorMessage">错误信息。</param> /// <returns>创建的 Web 请求代理辅助器错误事件。</returns> public static WebRequestAgentHelperErrorEventArgs Create(string errorMessage) { WebRequestAgentHelperErrorEventArgs webRequestAgentHelperErrorEventArgs = ReferencePool.Acquire <WebRequestAgentHelperErrorEventArgs>(); webRequestAgentHelperErrorEventArgs.ErrorMessage = errorMessage; return(webRequestAgentHelperErrorEventArgs); }
/// <summary> /// 创建下载代理辅助器更新数据流事件。 /// </summary> /// <param name="bytes">下载的数据流。</param> /// <param name="offset">数据流的偏移。</param> /// <param name="length">数据流的长度。</param> /// <returns>创建的下载代理辅助器更新数据流事件。</returns> public static DownloadAgentHelperUpdateBytesEventArgs Create(byte[] bytes, int offset, int length) { if (bytes == null) { Debug.LogError("Bytes is invalid."); } if (offset < 0 || offset >= bytes.Length) { Debug.LogError("Offset is invalid."); } if (length <= 0 || offset + length > bytes.Length) { Debug.LogError("Length is invalid."); } DownloadAgentHelperUpdateBytesEventArgs downloadAgentHelperUpdateBytesEventArgs = ReferencePool.Acquire <DownloadAgentHelperUpdateBytesEventArgs>(); downloadAgentHelperUpdateBytesEventArgs.m_Bytes = bytes; downloadAgentHelperUpdateBytesEventArgs.Offset = offset; downloadAgentHelperUpdateBytesEventArgs.Length = length; return(downloadAgentHelperUpdateBytesEventArgs); }
/// <summary> /// /// </summary> /// <returns></returns> public static DownloadAgentHelperProgressEventArgs Create(float downloadProgess) { if (downloadProgess <= 0) { Debug.LogError("downloadProgess is invalid."); } DownloadAgentHelperProgressEventArgs downloadAgentHelperDownloadProgressChangedEventArgs = ReferencePool.Acquire <DownloadAgentHelperProgressEventArgs>(); downloadAgentHelperDownloadProgressChangedEventArgs.DownloadProgess = downloadProgess; return(downloadAgentHelperDownloadProgressChangedEventArgs); }
/// <summary> /// 创建下载代理辅助器更新数据大小事件。 /// </summary> /// <param name="deltaLength">下载的增量数据大小。</param> /// <returns>创建的下载代理辅助器更新数据大小事件。</returns> public static DownloadAgentHelperUpdateLengthEventArgs Create(int deltaLength) { if (deltaLength <= 0) { Debug.LogError("Delta length is invalid."); } DownloadAgentHelperUpdateLengthEventArgs downloadAgentHelperUpdateLengthEventArgs = ReferencePool.Acquire <DownloadAgentHelperUpdateLengthEventArgs>(); downloadAgentHelperUpdateLengthEventArgs.DeltaLength = deltaLength; return(downloadAgentHelperUpdateLengthEventArgs); }