Unity Game Role
The Game Role tells the SDK which server, character and level the player is on. Payments and analytics key on it.
The one rule
Call AlogameAuth.SetGameRole() any time the player's server, character or level changes:
- right after login, once you know the starting server and character;
- after creating a character;
- whenever the player switches character or server (the SDK logs the switch-role event itself);
- whenever the player levels up.
C#
await AlogameAuth.SetGameRole(
serverId: player.ServerId,
roleId: player.CharacterId,
serverName: player.ServerName,
roleName: player.CharacterName,
level: player.Level);
When the player leaves to a character or server select screen with no role picked yet,
call AlogameAuth.LogoutGameRole() first, so no stale role backs purchases or analytics in the
meantime.
AlogameAuth.GetGameRole() returns the role last set (ServerId, ServerName, RoleId,
RoleName, Level).
The rules are the same as on the native SDKs; see Android Game Role for the details.