Hi guys, i’m new around unity/c#, and i’m trying to make an online leaderboard for a flappy bird like game,i followed Sebastian Lague’s Dreamlo tutorial,and from the looks of it, i need a username,and can’t quite figure it how to do it.I put an InputField in the main menu, but it doesn’t save it at all.
(No completions found for Player prefs)
Any help would be awesome. Thanks!
This is my wanna be code for that:
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
public class InputName : MonoBehaviour {
public string userName;
public GameObject inputField;
public void Awake()
{
userName = inputField.GetComponent<InputField> ().text;
}
}