C# Class KEngine.KHttpDownloader

多线程+断点续传 http下载器, 注意用完后要Dispose TODO: 线程的回调Callback有点难看,以后弄个KHttpDownloader2(本类稳定就不改本类)
Inheritance: UnityEngine.MonoBehaviour, IDisposable
Afficher le fichier Open project: mr-kelly/KEngine Class Usage Examples

Méthodes publiques

Свойство Type Description
Progress float
TotalSize int

Méthodes publiques

Méthode Description
Dispose ( ) : void
GetDatas ( ) : byte[]
GetFullSavePath ( string relativePath ) : string
Load ( string fullUrl, string saveFullPath, bool useContinue = false, bool useCache = false, int expireDays = 1, int timeout = 5 ) : KHttpDownloader

Load ( string fullUrl, string saveFullPath, int expireDays, int timeout = 5 ) : KHttpDownloader

Private Methods

Méthode Description
Init ( string fullUrl, string saveFullPath, bool useContinue, bool useCache = false, int expireDays = 1, int timeout = 10 ) : void
KHttpDownloader ( ) : System
OnDestroy ( ) : void
OnFinish ( ) : void
StartDownload ( string fullUrl ) : IEnumerator
ThreadableResumeDownload ( string url, int>.Action stepCallback, System.Action errorCallback, System.Action successCallback ) : void

Method Details

Dispose() public méthode

public Dispose ( ) : void
Résultat void

GetDatas() public méthode

public GetDatas ( ) : byte[]
Résultat byte[]

GetFullSavePath() public static méthode

public static GetFullSavePath ( string relativePath ) : string
relativePath string
Résultat string

Load() public static méthode

public static Load ( string fullUrl, string saveFullPath, bool useContinue = false, bool useCache = false, int expireDays = 1, int timeout = 5 ) : KHttpDownloader
fullUrl string
saveFullPath string 完整的保存路径!
useContinue bool 是否断点续传
useCache bool 如果存在则不下载了!
expireDays int
timeout int
Résultat KHttpDownloader

Load() public static méthode

public static Load ( string fullUrl, string saveFullPath, int expireDays, int timeout = 5 ) : KHttpDownloader
fullUrl string
saveFullPath string
expireDays int
timeout int
Résultat KHttpDownloader

Property Details

Progress public_oe property

public float Progress
Résultat float

TotalSize public_oe property

public int TotalSize
Résultat int