Player Centric API - Lifecycle Functions
Provide power and flexibility to the game maker
APIs & Definitions
|BeamContext.Start()||Starts tracking changes to the user state. Does nothing if the context has already been started.|
|BeamContext.Stop()||Coroutines stop, subscriptions stop, deletes |
|BeamContext.ClearPlayerAndStop()||Logs the player out and does the same thing as |
|BeamContext.ChangeAuthorizedPlayer(TokenResponse)||Switches the DBID of the context to the given player.|
BeamContext API calls will fail if it is stopped in the middle of an async method and will throw an exception. It must be started for these calls to work.
In the Unity Editor
When a BeamContext instance is initialized, a GameObject will be instantiated under Unity's "DontDestroyOnLoad" folder in the scene hierarchy. This GameObject will be named "Beamable" and contains information and behaviours for the currently running context, including:
• The current Authorized User
• Player Stats
• Subscription/Coroutine managers
Since this object is linked to the associated Context, calling
Stop() on the context will delete this object, and vice versa.
Updated 10 months ago