Guest User

Untitled

a guest
Jul 22nd, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class NewGame : MonoBehaviour {
  5.  
  6. public string nome = "";
  7.  
  8. void OnGUI()
  9. {
  10. GUI.Label (new Rect (100, 100, 40, 20), "Name:");
  11. nome = GUI.TextField(new Rect(160, 100, 150,20), nome, 30);
  12.  
  13. if(GUI.Button(new Rect(200, 200, 50, 20), "Start"))
  14. {
  15. PlayerPrefs.SetInt("NumberPlayer", MySingleton.Instance.numberPlayer);
  16. PlayerPrefs.SetString("Player" + MySingleton.Instance.numberPlayer.ToString() + "Name-" + nome, nome);
  17. Application.LoadLevel("Player");
  18. }
  19.  
  20. if(GUI.Button(new Rect(120, 200, 50, 20), "Cancel"))
  21. {
  22. Application.LoadLevel("Start");
  23. }
  24.  
  25. }
  26.  
  27.  
  28. }
Add Comment
Please, Sign In to add comment