12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.Networking;
- public class DownloadHander
- {
- public bool isFinish
- {
- get
- {
- if (HttpDownloadBasic == null)
- {
- return false;
- }
- return HttpDownloadBasic.isFinish;
- }
- }
- public float progressRate
- {
- get
- {
- if (UnityWebRequestAsyncOperation == null)
- {
- return 0;
- }
- return UnityWebRequestAsyncOperation.progress;
- }
- }
- public float maxSize;
- public byte[] Data{
- get
- {
- if (UnityWebRequestAsyncOperation == null||UnityWebRequestAsyncOperation.webRequest.result!=UnityWebRequest.Result.Success)
- {
- return null;
- }
- if (UnityWebRequestAsyncOperation.webRequest.downloadHandler is DownloadHandlerFile)
- {
- return null;
- }
- return UnityWebRequestAsyncOperation.webRequest.downloadHandler.data;
- }
- }
- public string Text{
- get
- {
-
- if (UnityWebRequestAsyncOperation == null)
- {
- return "";
- }
- return UnityWebRequestAsyncOperation.webRequest.downloadHandler.text;
- }
- }
- public HttpDownloadBasic HttpDownloadBasic;
- public System.Action<DownloadHander> OnFinishCallBack;
- public UnityWebRequestAsyncOperation UnityWebRequestAsyncOperation;
- }
|