29 lines
517 B
C#
29 lines
517 B
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class PlayerName : MonoBehaviour
|
|
{
|
|
public string nameOfPlayer;
|
|
public string saveName;
|
|
|
|
public Text inputText;
|
|
public string loadedName;
|
|
|
|
|
|
void Start()
|
|
{
|
|
nameOfPlayer = PlayerPrefs.GetString("name", "none");
|
|
loadedName = nameOfPlayer;
|
|
}
|
|
|
|
public void SetName()
|
|
{
|
|
saveName = inputText.text;
|
|
PlayerPrefs.SetString("name", saveName);
|
|
}
|
|
|
|
|
|
}
|