【问题标题】:error CS0117: `UnityEditor.PlayerSettings' does not contain a definition for `target IOS Graphics'错误 CS0117:“UnityEditor.PlayerSettings”不包含“目标 IOS 图形”的定义
【发布时间】:2015-06-18 19:44:29
【问题描述】:

我正在尝试在 Android 设备(三星 Gs3)上构建 Google 纸板演示应用程序,但我遇到了问题。我收到一个错误

"错误 CS0117: `UnityEditor.PlayerSettings' 不包含 CardboardEditor.cs 中“目标 IOS 图形”的定义。

有人可以建议我我做错了什么。帮我解决错误。我正在使用

统一 4.6.2

Cardboard SDK for Unity v0.5

目标平台:安卓

【问题讨论】:

  • 错误信息是指一个文件CardboardEditor.cs,它可能是Cardboard SDK的一部分。您是否对该文件进行了任何更改?如果是这样,请尝试还原它们。如果没有,您也许可以修复它,或联系 SDK 开发人员。

标签: unity3d google-cardboard


【解决方案1】:

替换这个:

private static void CheckGraphicsAPI()
{
    if (EditorUserBuildSettings.activeBuildTarget == BuildTarget.iPhone
        && !Application.isPlaying
        && Object.FindObjectOfType<Cardboard>() != null
        && PlayerSettings.targetIOSGraphics != TargetIOSGraphics.OpenGLES_2_0
        && PlayerSettings.targetIOSGraphics != TargetIOSGraphics.OpenGLES_3_0)
    {
        Debug.LogWarning("iOS Graphics API should be set to OpenGL for best distortion-"
          + "correction performance in Cardboard.");
    }
}

有了这个:

private static void CheckGraphicsAPI()
{
    if (EditorUserBuildSettings.activeBuildTarget == BuildTarget.iPhone
        && !Application.isPlaying
        && Object.FindObjectOfType<Cardboard>() != null
        && PlayerSettings.GetGraphicsAPIs(BuildTarget.iPhone).Contains(GraphicsDeviceType.OpenGLES2)
        && PlayerSettings.GetGraphicsAPIs(BuildTarget.iPhone).Contains(GraphicsDeviceType.OpenGLES3))
    {
        Debug.LogWarning("iOS Graphics API should be set to OpenGL for best distortion-"
          + "correction performance in Cardboard.");
    }
}

【讨论】:

  • 这又给了我一个错误 CS0117:UnityEditor.BuildTarget' does not contain a definition for iOS'。我尝试评论脚本并构建它,但应用程序崩溃了。
猜你喜欢
  • 1970-01-01
  • 2019-10-30
  • 1970-01-01
  • 1970-01-01
  • 2012-12-17
  • 2011-02-18
  • 1970-01-01
  • 2012-12-21
  • 2018-09-29
相关资源
最近更新 更多