Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- public class PlayerChoose : MonoBehaviour {
- void OnGUI()
- {
- if(GUI.Button( new Rect(220, 100, 100, 50), PlayerPrefs.GetString("Player1Name")))
- {
- if(player1=="New game")
- {
- MySingleton.Instance.numberPlayerPub = 1;
- Application.LoadLevel("NewPlayer");
- }
- }
- if(GUI.Button( new Rect(220, 200, 100, 50), PlayerPrefs.GetString("Player2Name")))
- {
- if(player2=="New game")
- {
- MySingleton.Instance.numberPlayerPub = 2;
- Application.LoadLevel("NewPlayer");
- }
- }
- if(GUI.Button( new Rect(220, 300, 100, 50), PlayerPrefs.GetString("Player3Name")))
- {
- if(player3=="New game")
- {
- MySingleton.Instance.numberPlayerPub = 3;
- Application.LoadLevel("NewPlayer");
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment