android - 使用 Google Cardboard SDK Unity,当一个可能在每一帧实例化的对象出现在 View 中时,显示变黑

标签 android unity3d google-cardboard

问题

当一个可能在每一帧实例化的对象出现在 View 中时,显示变黑

如何重现

  • 在项目上导入Cardboard SDK
  • 使用以下代码将脚本分配给任何适当的对象。

public GameObject prefab;
void GenerateObject(){
  Instantiate(prefab);
}
void Update(){
if ( once ){
    GenerateObject();
  }
}

  • 在 Unity 检查器上将任何适当的预制件附加到上面的预制件。
  • 使用“Build and Run”在 Android 设备上启动应用程序。
  • 当可能在每一帧实例化的对象出现在 View 中时,显示变黑。设置按钮也将消失。当实例化对象不在视线范围内时, View 变为正常。设置按钮将出现。

环境

Unity版本:5.0.0.1f

Cardboard SDK版本:v0.4.9

设备:Nexus5, nVidia SHIELD Tablet 2

最佳答案

Unity 和 CardboardSDK 之间存在一个已知错误。尝试在 Unity 的build设置中将build设置为开发。如果这解决了问题,那么您就找到了罪魁祸首。

由于这个错误,当我想要一个可以上传到 Play 商店的构建时,禁用场景中的大部分照明有时会有所帮助。

我们都在耐心等待修复。 Google 和 Unity 正在共同努力,但据说这是一个棘手的问题。

查看 known issues in SDK release notes .

Known Issues

Unity 5 rendering issues: As of Unity build 5.0.0f4, the following steps should be taken to fix or ameliorate any rendering issues, such as an all-black screen, flashing textures, or non-stereo views: Enable the Development Build option in the Build dialog. This seems to fix various rendering glitches, like flashing textures.

The root cause of the rendering glitches is under analysis, with assistance from Unity.

Note: If you are using any Image Effects, make sure that StereoController's Direct Render property is set to false. Check if that fixes the issue first.

关于android - 使用 Google Cardboard SDK Unity,当一个可能在每一帧实例化的对象出现在 View 中时,显示变黑,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29756243/

相关文章:

android - 在 android 中延迟加载 recyclerView

android - 在 actionbarsherlock 中单击选项卡时调用新的 Activity 类

c# - 从程序集 c# 引用 .dll

javascript - 如何缩放 block 元素以在不同的移动屏幕上显示相同的大小?

android - Unity3d 中的 Google Cardboard 演示 : How to center a 3D object in your field of vision by double tapping touchscreen?

c# - 移动纸板

android - 此 Material API 是实验性的,将来可能会更改或删除。使用新的 material3 卡时 android 出错

android - 未设置 "ArrayAdapter"

c# - 我有一个奇怪的错误

unity3d - 团结 |如何根据 Inspector 上的主枚举选择更改枚举