public void Init(Action onSuccess = null, Action <string> onFail = null) { slideshow = gameObject.AddComponent <Slideshow>(); slideshow.SlideDuration = SlideDuration; slideshow.SwapDuration = SwapDuration; this.onSuccess = onSuccess; this.onFail = onFail; var controlFileUrl = $"{CONTROL_FILE_FOLDER}/{ControlFileName}.json"; StartCoroutine(JSONDownloader.StartDownload(controlFileUrl, OnJSONDownloadSuccess, onFail)); }
public void onDownloadButtonPressed() { for (int i = 0; i < 35; i++) { JSONDownloader .Initialize() .SetUrl(serverUrl + "uploaded_images/CapitanAfrica/" + i.ToString() + ".txt") .SetJsonFilePath(Paths.LEVELS_EDIT + i.ToString() + ".txt") .SetFieldName("myimage") .OnError(error => Debug.Log(error)) .OnComplete(text => Toast.Instance.Show("SUCCES Downloading")) .Download(); } }