using System.Collections; using System.Collections.Generic; using UnityEngine; public class UserInfo { //设备sn号 public static string Serialno = string.Empty; //影创账号 public static string Account = string.Empty; //影创应用号 public static string AppID = string.Empty; //影创Token public static string Token = string.Empty; //应用Token public static string User_Token = string.Empty; //应用uid public static string uid = string.Empty; public static SystemDatas systemDatas; /// /// 判断是否为游客账号 /// /// true, if vistor account was ised, false otherwise. public static bool isVistorAccount() { return Serialno == Account; } /// /// 判断用户是否登陆 /// /// true, if login was ised, false otherwise. public static bool isLogin() { return Account != string.Empty; } private string _userToken; private int _userTokenExpireTime; private int _id; private string _nickName; public string _avatar; public string _devideID; public string _phone; public string _email; private bool _isActivate; public string UserToken { get => _userToken; } public int UserTokenExpireTime { get => _userTokenExpireTime; } public int Id { get => _id;} public string NickName { get => _nickName; } public bool IsActivate { get => _isActivate; } public void SetTokenInfo(string token, int expireTime) { _userToken = token; _userTokenExpireTime = expireTime; } public void SetUserInfo(int id, string token = "", int expireTime = 0, string avatar = "", string nickName = "", bool isActivate=false, string phoneNum = "", string email = "", string deviceID = "") { this._id = id; this._avatar = avatar; this._nickName = nickName; this._phone = phoneNum; this._email = email; this._devideID = deviceID; this._isActivate = isActivate; SetTokenInfo(token, expireTime); } public void UserClear(int id, string token = "", int expireTime = 0) { SetUserInfo(id, token, expireTime); } public void SetNickNameAvatar(string avatar, string nickName) { this._avatar = avatar; this._nickName = nickName; } }