You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
1001 B
38 lines
1001 B
using UnityEngine;
|
|
|
|
public static class LocalPlayerData
|
|
{
|
|
public static ulong ID;
|
|
public static string PlayerName;
|
|
public static string Email;
|
|
public static string AvatarID;
|
|
public static string RoomID;
|
|
|
|
static LocalPlayerData()
|
|
{
|
|
ID = (ulong) Random.Range(0, int.MaxValue);
|
|
PlayerName = "Player_TEST" + Random.Range(1, 1000);
|
|
RoomID = "Room1";
|
|
AvatarID = "char_james";
|
|
}
|
|
|
|
public static void Set(UserLoginResult userLogin)
|
|
{
|
|
try
|
|
{
|
|
ID = ulong.Parse(userLogin.id);
|
|
PlayerName = userLogin.login;
|
|
Email = userLogin.email;
|
|
AvatarID = userLogin.avatarId;
|
|
RoomID = userLogin.roomId;
|
|
}
|
|
catch (System.FormatException)
|
|
{
|
|
Debug.Log("Conversion failed: Invalid format.");
|
|
}
|
|
catch (System.OverflowException)
|
|
{
|
|
Debug.Log("Conversion failed: Value is too large or too small.");
|
|
}
|
|
}
|
|
}
|
|
|