Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- public class NewGame : MonoBehaviour {
- public string nome = "";
- void OnGUI()
- {
- GUI.Label (new Rect (100, 100, 40, 20), "Name:");
- nome = GUI.TextField(new Rect(160, 100, 150,20), nome, 30);
- if(GUI.Button(new Rect(200, 200, 50, 20), "Start"))
- {
- PlayerPrefs.SetInt("NumberPlayer", MySingleton.Instance.numberPlayer);
- PlayerPrefs.SetString("Player" + MySingleton.Instance.numberPlayer.ToString() + "Name-" + nome, nome);
- Application.LoadLevel("Player");
- }
- if(GUI.Button(new Rect(120, 200, 50, 20), "Cancel"))
- {
- Application.LoadLevel("Start");
- }
- }
- }
Add Comment
Please, Sign In to add comment