Ejemplo n.º 1
0
    private void OnStateChanged(DownloadRequest req, DownloadRequest.DownloadState state)
    {
        switch (state)
        {
        case DownloadRequest.DownloadState.Init:
            break;

        case DownloadRequest.DownloadState.Downloading:
        case DownloadRequest.DownloadState.Moving:
            ProgressText.text = "Downloading...";

            if (URLText.text == string.Empty)
            {
                URLText.text      = req.Url;
                ProgressBar.Value = 0.0f;
            }

            break;

        case DownloadRequest.DownloadState.Complete:
            ProgressText.text = "Download Finished!";
            URLText.text      = string.Empty;
            break;

        case DownloadRequest.DownloadState.Failed:
            ProgressText.text = "Download Failed!";
            URLText.text      = string.Empty;
            break;

        default:
            throw new ArgumentOutOfRangeException("state", state, null);
        }
    }
Ejemplo n.º 2
0
 public void OnStateChanged(DownloadRequest req, DownloadRequest.DownloadState state)
 {
     StateChanged(req, state);
 }