从Windows Phone库加载图像时出现Unity错误

时间:2015-04-17 07:34:40

标签: image windows-phone-8 unity3d load gallery

我为我的Unity应用程序开发了一个Windows Phone插件,这使我能够打开Windows Phone库以选择图像并获得其物理路径。

我已使用此路径使用WWW对象在应用程序中加载图像,但我收到此错误

"错误。操作失败,错误0x80070005:访问被拒绝。"

路径正确,因为我显示它。

这是我的测试代码,用路径加载图像。

 IEnumerator loadImage()
 {
     this.guiText.text = filePath;
     WWW www = new WWW(filePath);
     yield return www;

     if(www.error == null)
     {
         GameObject texture = GameObject.Find("UNITY");
         if(texture != null)
         {
             texture.guiTexture.texture = www.texture;
         }
     }
 }

任何帮助将不胜感激!提前谢谢!

1 个答案:

答案 0 :(得分:1)

我认为您需要启用应用程序的权限才能访问设备中的读取文件。

转到App Manifest文件并检查它是否已启用,否则将解决您的问题。

相关问题