_xiaofang/xiaofang/Assets/Script/loginScripts/AccountManager.cs
2025-01-02 16:55:57 +08:00

24 lines
536 B
C#

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class AccountManager : MonoBehaviour
{
private const string AccountKey = "LastLoggedAccount";
// 保存账号名
public static void SaveLastLoggedAccount(string accountName)
{
PlayerPrefs.SetString(AccountKey, accountName);
//PlayerPrefs.Save();
}
// 获取上次登录的账号名
public static string GetLastLoggedAccount()
{
return PlayerPrefs.GetString(AccountKey,string.Empty);
}
}