|
async Promise< BeamContext > | ChangeAuthorizedPlayer (TokenResponse token) |
| A BeamContext is configured for one authorized user. If you wish to change the user, you need to give it a new token. You can get TokenResponse values from the IAuthService by calling various log in methods. More...
|
|
IObservedPlayer | ObservePlayer (long otherPlayerId) |
| Using the authorization associated with the current context, observe the public data of another player More...
|
|
BeamContext | Start () |
| After a context has been Stopped with the Stop method, this method can restart the instance. More...
|
|
async Promise | Stop () |
| This method will tear down a BeamContext and notify all internal services that the context should be destroyed. All coroutines associated with the context will stop. No notifications will be received internal to the context. No services will be accessible from the ServiceProvider after Stop has been called. More...
|
|
async Promise | ClearPlayerAndStop () |
| Clear the authorization token for the PlayerCode, then internally calls Stop
|
|
void | ChangeTime () |
|
Promise | OnDispose () |
| Used as a way to allow services attached to a IDependencyProvider to clean up their state when the IDependencyProviderScope.Dispose method is called More...
|
|
|
string | PlayerCode [get] |
| The PlayerCode is the name of a player's slot on the device. The Default context uses an empty string, but you could use values like "player1" and "player2" to enable a feature like couch-coop.
|
|
IDependencyProvider | ServiceProvider [get] |
| The IDependencyProvider is a collection of all services required to provide a Beamable SDK full funcitonality
|
|
bool | IsStopped [get] |
| If the Stop method has been run, this property will return true. Once a context is disposed, you shouldn't use it anymore, and the ServiceProvider will throw exceptions if you do. You can re-initialize the context by using InParent
|
|
GameObject | GameObject [get] |
| Each BeamContext has a set of components that need to live on a gameObject in the scene.
|
|
bool | IsInitialized [get] |
|
bool | IsDefault [get] |
|
long???? | PlayerId [get] |
|
string | Cid [get] |
|
string | Pid [get] |
|
AccessToken | AccessToken [get] |
|
IBeamableRequester | Requester [get] |
|
CoroutineService | CoroutineService [get] |
|
PlayerAnnouncements | Announcements [get] |
|
PlayerStats | Stats [get] |
|
PlayerLobby | Lobby [get] |
| Access the PlayerLobby for this context.
|
|
PlayerInventory | Inventory [get] |
|
IContentApi | Content [get] |
| Access the IContentApi for this player.
|
|
ApiServices | Api [get] |
| Access the IBeamableAPI for this player.
|
|
string?? | TimeOverride [getset] |
|
static BeamContext | Default [get] |
| A static BeamContext that uses a PlayerCode of an empty string. By default, the default context will persist between scene reloads. If you need to dispose it, you'll need to manually invoke Stop
|
|
static IEnumerable< BeamContext > | All [get] |
| Finds all BeamContexts that have been created. This may include disposed contexts.
|
|
Promise< Unit > | OnReady [get] |
|
User | User [get] |
| The User for this player instance.
|
|
Promise< Unit > | OnReady [get] |
| A Promise that completes once the user has initialized for this player instance.
|
|
INotificationService | Notification [get] |
| Access to the INotificationService for this player instance.
|
|
IPubnubNotificationService | PubnubNotificationService [get] |
| Access to the IPubnubNotificationService for this player instance.
|
|
IHeartbeatService | Heartbeat [get] |
| Access to the IHeartbeatService for this player instance.
|
|
string | Cid [get] |
| The current Customer ID for this player instance.
|
|
string | Pid [get] |
| The current Realm ID for this player instance.
|
|
string | TimeOverride [getset] |
| A time override that can be used to fake the current Beamable known time. This can be useful to checking Listing or Announcement times.
|
|
IConnectivityService | ConnectivityService [get] |
| Access to the IConnectivityService for this player instance.
|
|
CoroutineService | CoroutineService [get] |
| Access to the CoroutineService for this player instance.
|
|
long | UserId [get] |
| The current gamertag of this context
|
|
GameObject | GameObject [get] |
|
PlayerStats | Stats [get] |
|
PlayerLobby | Lobby [get] |
|
The BeamContext represents a player's session and is equipped with all required services. BeamContext instances are not tied to scene memory. Instead, BeamContext instances live in a static way. However, if a BeamableBehaviour is connected to a BeamContext, then the BeamableBehaviour's lifecycle will control the `BeamContext's lifecycle. Additionally, the PlayerCode variable is the unique id of the BeamContext.
From Monobehaviours or Unity components, you should use the InParent method to access a BeamContext. The InParent will give you the closest context in the Unity object heirarchy from your script's location, or give you Default if no context exists. You can add BeamableBehaviour components to add a context to a GameObject.
If you want to access an instance without using a context sensitive approach, you should use the Instantiate method. Finally, you can always use Default.
Remember, there will only ever be one instance of BeamContext per PlayerCode value. The Default context has a PlayerCode value of an empty string.