Skip to content
On this page

User (Class)

Manages authentication and data for the currently logged-in user.

Fields

FieldDescription
string idUnique identifier for the user.
string memberNameName of the member.
bool? isSubscriberNullable boolean indicating if the user is a subscriber. null if unknown.
[HideInInspector] string tokenToken associated with the user, hidden in the Unity Inspector.

Methods

Login

Logs the user in either using a token (for WebGL builds) or as a guest.

ParameterDescription
System.Action onSuccessCallback executed upon successful login.
System.Action<string> onErrorCallback executed on error.

ShowLoginDialog

Displays the login dialog to the user.

ParameterDescription
System.Action onSuccessCallback executed upon successful login.

IsSubscriber

Determines if the user is a subscriber.

ParameterDescription
System.Action<bool> onSuccessCallback executed upon determining the subscription status.
System.Action<string> onErrorCallback executed on error.

IsGuest

Checks if the user is logged in as a guest.

ParameterDescription
Return Typebool

SetData

Sets data for the logged-in user.

ParameterDescription
string keyThe key to set data for.
string valueThe value associated with the key.
System.Action onSuccessCallback executed upon successful data set.
System.Action<string> onErrorCallback executed on error.

GetData

Retrieves data for the logged-in user.

ParameterDescription
System.Action<List<UserData>> onSuccessCallback executed upon successful data retrieval.
System.Action<string> onErrorCallback executed on error.