Guest User

Untitled

a guest
Jul 22nd, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class PlayerChoose : MonoBehaviour {
  5.  
  6. void OnGUI()
  7. {
  8. if(GUI.Button( new Rect(220, 100, 100, 50), PlayerPrefs.GetString("Player1Name")))
  9. {
  10. if(player1=="New game")
  11. {
  12. MySingleton.Instance.numberPlayerPub = 1;
  13. Application.LoadLevel("NewPlayer");
  14. }
  15. }
  16. if(GUI.Button( new Rect(220, 200, 100, 50), PlayerPrefs.GetString("Player2Name")))
  17. {
  18. if(player2=="New game")
  19. {
  20. MySingleton.Instance.numberPlayerPub = 2;
  21. Application.LoadLevel("NewPlayer");
  22. }
  23. }
  24. if(GUI.Button( new Rect(220, 300, 100, 50), PlayerPrefs.GetString("Player3Name")))
  25. {
  26. if(player3=="New game")
  27. {
  28. MySingleton.Instance.numberPlayerPub = 3;
  29. Application.LoadLevel("NewPlayer");
  30. }
  31. }
  32.  
  33. }
  34.  
  35.  
  36. }
Add Comment
Please, Sign In to add comment