private IEnumerator LoadImage(string str) { using (UnityWebRequest uwr = UnityWebRequestTexture.GetTexture(str)) { yield return(uwr.SendWebRequest()); if (uwr.isNetworkError || uwr.isHttpError) { Debug.Log(uwr.error); } else { txt = new Texture2D(2, 2, TextureFormat.RGB24, false); txt = DownloadHandlerTexture.GetContent(uwr); ResizeImage rimage = this.gameObject.AddComponent <ResizeImage>(); txt = rimage.ScaleTexture(txt); BildRawData brd = new BildRawData(); brd.BildHight = txt.height; brd.BildWidth = txt.width; brd.BildRaw = txt.GetRawTextureData(); speise.Bild = brd; UpdateInput(); } } }