void Update() { if (Input.GetKeyDown(KeyCode.Alpha1)) { btn1player.on = true; btn2player.on = false; players = Player.PlayerNum.PlayerOne; } else if (Input.GetKeyDown(KeyCode.Alpha2)) { btn1player.on = false; btn2player.on = true; players = Player.PlayerNum.PlayerTwo; } else if (Input.GetKeyDown(KeyCode.Alpha3)) { btnKeyboard.on = !btnKeyboard.on; } else if (Input.GetKeyDown(KeyCode.Alpha5)) { GameManager.instance.StartGame(players); } else if (Input.GetKeyDown(KeyCode.Alpha0)) { Application.Quit(); } }
public void StartGame(Player.PlayerNum players) { sessionPlayers = players; p1Score = 0; p2Score = 0; p1Lives = 4; p2Lives = players == Player.PlayerNum.PlayerTwo ? 4 : -1; MainMenu.instance.gameObject.SetActive(false); levelManager.LoadLevel(1); }
void Start() { btn1player.on = true; btn2player.on = false; players = Player.PlayerNum.PlayerOne; }