24 lines
536 B
C#
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);
|
|
}
|
|
}
|