public virtual void ReqTexture(string url, TextureCB_CallerID callerId) { // TODO: error handling if (!string.IsNullOrEmpty(url)) { StartCoroutine(OutputRoutine(url, callerId)); } }
private IEnumerator OutputRoutine(string url, TextureCB_CallerID callerId) { var loader = new WWW(url); yield return(loader); Texture2D _texture; _texture = new Texture2D(loader.texture.width, loader.texture.height); _texture = loader.texture; if (callerId == TextureCB_CallerID.APP_IMG) { _imgSrvReceiver.TextureCB(_texture, url); } else if (callerId == TextureCB_CallerID.APP_UNIT) { _unitSrvReceiver.TextureU_CB(_texture, url); } }