Unity
Unity integration
Introduction
The user profile module is used to store user specific data related to his identity.
UserProfileData class methods
GetRGNCoinBalance();
Return the amount of rgn-coin for this user.
GetCustomCoinBalance(string currencyName);
Return the amount of your custom currency for this user.
Load User Profile
using RGN;
using RGN.Modules.UserProfile;
using UnityEngine;
public class UserProfileExample : MonoBehaviour
{
public async void LoadUserProfileDataAsync()
{
string userId = RGNCore.I.MasterAppUser.UserId;
UserProfileData userProfileData = await UserProfileModule.I.GetFullUserProfileAsync<UserProfileData>();
Debug.Log($"Display name : {userProfileData.displayName} \n" +
$"Bio : {userProfileData.bio} \n" +
$"Email : {userProfileData.email} \n");
}
}Update UserName/Display Name
Update User Bio
Retrieve User Currencies
"rgn-coin" Currency
Similar to other in-game currencies but it can only be obtained by making In-App Purchases - it cannot be earned or given as a reward to players. It is consumed to purchase NFT Virtual Items. For more details about the rgn-coin, please refer to the Currency module.
Last updated
Was this helpful?