IEnumerator loadImage(string url, SQSourceLoad loadCall) { if (url != null && url.Replace(" ", "") != "") { WWW www = new WWW(url); while (!www.isDone) { yield return(new WaitForSeconds(0.01f)); } yield return(www); if (www.texture != null && string.IsNullOrEmpty(www.error)) { if (loadCall != null) { loadCall(www.texture); } } } }
public void LoadSource(string url, SQSourceLoad loadCall) { StartCoroutine(loadImage(url, loadCall)); }