Проблема с пользовательским интерфейсом в Unity Daydream

Как вы можете видеть на прикрепленном изображении, в представлении игры в моем проекте Unity есть некоторые проблемы. Похоже, что он дублирует вид, увеличивая меньшие фрагменты основного вида. Любое исправление для этого?

Я запускаю бета-версию Unity 5.6.0 с ресурсом Daydream VR.

Проблема пользовательского интерфейса


person Boulderbuff64    schedule 18.02.2017    source источник


Ответы (1)


Это будет исправлено в следующем обновлении. А пока воспользуйтесь обходным решением, опубликованным ниже:

Похоже, это проблема, появившаяся в версии 5.6. Я не уверен, было ли это намеренным изменением в Unity или регрессом. Пока у нас нет решения, следующие изменения исправят это для пользователей SDK.

diff --git a/GoogleVR/Legacy/Scripts/Internal/GvrEye.cs b/GoogleVR/Legacy/Scripts/Internal/GvrEye.cs
index 06e3692..8ce0021 100644
--- a/GoogleVR/Legacy/Scripts/Internal/GvrEye.cs
+++ b/GoogleVR/Legacy/Scripts/Internal/GvrEye.cs
@@ -210,6 +210,7 @@ public class GvrEye : MonoBehaviour {
       stereoEffect = GetComponent<StereoRenderEffect>();
       if (stereoEffect == null) {
         stereoEffect = gameObject.AddComponent<StereoRenderEffect>();
+        stereoEffect.eye = eye;
       }
       stereoEffect.enabled = true;
     } else if (stereoEffect != null) {
diff --git a/GoogleVR/Legacy/Scripts/Internal/StereoRenderEffect.cs b/GoogleVR/Legacy/Scripts/Internal/StereoRenderEffect.cs
index d7020b1..cb18c00 100644
--- a/GoogleVR/Legacy/Scripts/Internal/StereoRenderEffect.cs
+++ b/GoogleVR/Legacy/Scripts/Internal/StereoRenderEffect.cs
@@ -26,7 +26,9 @@ public class StereoRenderEffect : MonoBehaviour {

   private Camera cam;

-  private static readonly Rect fullRect = new Rect(0, 0, 1, 1);
+  private Rect fullRect;
+
+  public GvrViewer.Eye eye;

   void Awake() {
     cam = GetComponent<Camera>();
@@ -34,6 +36,7 @@ public class StereoRenderEffect : MonoBehaviour {

   void Start() {
     material = new Material(Shader.Find("GoogleVR/UnlitTexture"));
+    fullRect = (eye == GvrViewer.Eye.Left ? new Rect (0, 0, 0.5f, 1) : new Rect (0.5f, 0, 0.5f, 1));
   }

   void OnRenderImage(RenderTexture source, RenderTexture dest) {
person Mira    schedule 21.02.2017
comment
Добро пожаловать в StackOverflow. Пожалуйста, укажите, что находится в ссылке, чтобы ответ был полезен. Лучший - person Løiten; 21.02.2017