IEnumerator ChangeImage() { string mCode = readFile.getMeetingCode(); string url = "http://" + readFile.GetFileServerIdentifier() + ":" + readFile.GetFileServerPort() + "/" + mCode + "/" + currentSlideNumber + ".jpg"; using (WWW www = new WWW(url)) { yield return(www); if (!string.IsNullOrEmpty(www.error)) { //End of the slides must've been reached if (www.error.Contains("404")) { SetMaxSlideNumber(currentSlideNumber); FixSlideNumber(); } } else { pBoard.GetComponent <Renderer>().material.mainTexture = www.texture; } } }