_xiaofang/xiaofang/Assets/Script/loginScripts/AccountManager.cs

24 lines
568 B
C#
Raw Normal View History

2025-01-02 16:27:21 +08:00
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class AccountManager : MonoBehaviour
{
private const string AccountKey = "LastLoggedAccount";
// <20><><EFBFBD><EFBFBD><EFBFBD>˺<EFBFBD><CBBA><EFBFBD>
public static void SaveLastLoggedAccount(string accountName)
{
PlayerPrefs.SetString(AccountKey, accountName);
PlayerPrefs.Save();
}
// <20><>ȡ<EFBFBD>ϴε<CFB4>¼<EFBFBD><C2BC><EFBFBD>˺<EFBFBD><CBBA><EFBFBD>
public static string GetLastLoggedAccount()
{
return PlayerPrefs.GetString(AccountKey, null); // Ĭ<><C4AC>ֵΪ null<6C><6C><EFBFBD><EFBFBD><EFBFBD><EFBFBD>û<EFBFBD>б<EFBFBD><D0B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˺<EFBFBD><CBBA><EFBFBD>
}
}