Access core properties of the currently running game instance.

Properties

gameId: string

While in editor, this will reflect whatever is defined in Assets/GameConfig.asset

localPlayer: Player = ...

The local client's player.

On the server this is undefined.

There is a brief moment on client startup when localPlayer is undefined. You can listen for when the local player is loaded with WaitForLocalPlayerLoaded

organizationId: string

Empty string when in editor.

platform: AirshipPlatform = ...

The platform of this device.

To get a certain player's platform, use Player.platform

serverId: string

Empty string when in editor.

Methods

  • Returns boolean

    True if this game instance is acting as a player client. When published this will be true for all players. In local development in Shared Server Mode this will also be true (because the client is operating as both server and client).

  • Shortcut for checking if both IsClient() and IsServer() is true.

    Returns boolean

  • Returns true if device is a phone or tablet.

    Returns false if on desktop or console.

    Returns boolean

  • Returns boolean

    True if this game instance is acting as the server. When published this will only be true on the game server. In local development in Shared Server Mode this will also be true (because the client is operating as both server and client).

  • Yields until Game.gameData has been loaded.

    Returns GameDto