我使用iOS Unity插件将图像路径发送到Unity。然后在Unity中,我试图使用接收到的路径获取此图像(我没有其他想法如何从iphone发送图像到unity)。问题是:我仍然无法获取该图像。 WWW错误:在服务器上未找到请求的URL。
//Tried both "file:///..." and "file://..."
string path = "file://var/mobile/Applications/173DE26D-4C0E-4DF7-9DC6-9CBB7D4FC954/Documents/Images/image.png"
Texture texture;
IEnumerator WaitForRequest(WWW www) {
yield return www;
if (www.error == null) {
texture = www.texture;
}
}
void Start() {
WWW www = new WWW(path);
StartCoroutine(WaitForRequest(www));
}