error CS0117: `UnityEditor.PlayerSettings' does not contain a definition for `target IOS Graphics'

8.6k views Asked by At

Im trying to build Google cardboard Demo application on to Android Device(Samsung Gs3), but Im facing a problem. I get an error

"error CS0117: `UnityEditor.PlayerSettings' does not contain a definition for 'target IOS Graphics'" in CardboardEditor.cs.

Can someone suggest me what mI doing wrong. Help me solve the bug. Im using

Unity 4.6.2

Cardboard SDK for Unity v0.5

Target Platform : Android

1

There are 1 answers

1
luizcarlosfx On

Replace this:

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.");
    }
}

With this:

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.");
    }
}