Skip to content

GEM_GameInstance

← Back to Runtime | Home

Namespace: wevr.GEM.Runtime

Type: Class

Inherits: MonoBehaviour

Description

Handles an instance of the game. That is, the client-side setup of a client & player. This script needs to exist in the client's startup scene and stays persistent on the client. This is executed locally on a client.If the gameInstance is ready, bool Ready is set to true. Once ready, this class provides information about the player of this instance, such as playerid or height. However, this information is only valid on the local client. To get other client's data, use the synchronized data in GEM_ClientExperience. This script is null on the server.

Properties

AvatarIndex

int AvatarIndex { get; set; }

The avatar index that the local player has chosen according to GEM.

GemUserId

int GemUserId { get; set; }

The PlayerId of the local player according to GEM.

Instance

static GEM_GameInstance Instance { get; set; }

Get the Singleton Instance. Note: ONLY exists on client. The instance will return null on dedicated servers.

LanguageCode

static string LanguageCode { get; set; }

The language code of the local player according to GEM.

PlayerHeight

float PlayerHeight { get; set; }

The height of the local player in cm.

Ready

static bool Ready { get; set; }

Is true if the GameInstance is initialized and ready This should be checked before getting player information such as PlayerId or PlayerHeight.

UserHandle

string UserHandle { get; set; }

The name of the User.

deviceState

DeviceState deviceState { get; set; }

The device State according to GEM.

deviceStateRunner

GEMDeviceStateRunnable deviceStateRunner { get; set; }

The device state runner. Updates GEM about the device periodically about the device, e.g. battery percentage.