Skip to main content
Version: 3.5

class GameViewUtils

(Niantic.Lightship.AR.Utilities.GameViewUtils)

Overview

class GameViewUtils {
public:
// methods

static ScreenOrientation GetEditorScreenOrientation();
static ScreenOrientation GetGameViewAspectRatio(XRCameraParams cameraParams);
};

Detailed Documentation

Methods

GetEditorScreenOrientation

static ScreenOrientation GetEditorScreenOrientation()

Calculates the screen orientation via the game view aspect ratio. Use this method instead of UnityEngine.Screen.orientation in Editor, as the latter only returns Portrait in Editor.

    Returns:

    The screen orientation. When this method is called in a platform other than the Unity Editor, it defaults to return ScreenOrientation.Portrait.