谷歌纸板适应其他屏幕

时间:2015-11-11 07:36:45

标签: android unity3d galaxy google-cardboard

我使用谷歌纸板作为统一SDK,它允许你使用不同的手机,但我使用的是不在列表中的星系S2。

代码中的定义如下所示:

 /// Parameters for a Nexus 6 device.
  public static readonly Screen Nexus6 = new Screen {
    width = 0.133f,
    height = 0.074f,
    border = 0.004f
  };

  /// Parameters for a Galaxy S6 device.
  public static readonly Screen GalaxyS6 = new Screen {
    width = 0.114f,
    height = 0.0635f,
    border = 0.0035f
  };

有谁知道那些参数和巫婆单位是什么?

2 个答案:

答案 0 :(得分:1)

/// Information about the screen.  All distances are in meters, measured as the phone is expected
  /// to be placed in the Cardboard, i.e. landscape orientation.
  [System.Serializable]
  public struct Screen {
    public float width;   // The long edge of the phone.
    public float height;  // The short edge of the phone.
    public float border;  // Distance from bottom of the cardboard to the bottom edge of screen.
  }

答案是:)

答案 1 :(得分:1)

该特定列表仅在Unity编辑器中播放场景时使用。它本质上是一个模拟器。在手机上运行时,会从手机本身收集值。