// Use this for initialization void Start() { GameObject gmControl = GameObject.FindGameObjectWithTag("GameController"); if (gmControl != null) { controller = gmControl.GetComponent <GameController> (); controller.player1Name = _p1NameDown; controller.player2Name = _p2NameDown; controller.pow1 = pow1; controller.pow2 = pow2; controller.SetName(); pow1 = controller.pow1; pow2 = controller.pow2; } winnerMenu.SetWinnerMenuAble(false); _gestureBang = GestureDetectureBang.GetSharedGestureDetector(); _gestureBang.AddListener(this); ChangeStateTo(GameState.Default); ads = new PowliticosADS(); }
private void CheckWinner() { if (_upPoints == 3) { Debug.Log("Player UP WINNER"); //powWinner.SetPowliticoWithType(controller.player2); controller.powWinner = winnerMenu.WinnerPow; controller.SetPowliticoWinner(controller.player2); winnerMenu.WinnerPow = controller.powWinner; winnerMenu.SetWinnerMenuAble(true); AbleGame(false); } else if (_downPoints == 3) { Debug.Log("Player DOWN WINNER"); //powWinner.SetPowliticoWithType(controller.player1); controller.powWinner = winnerMenu.WinnerPow; controller.SetPowliticoWinner(controller.player1); winnerMenu.WinnerPow = controller.powWinner; winnerMenu.SetWinnerMenuAble(true); AbleGame(false); } else { ShowUpMenu(); ShowDownMenu(); // _textButtonDown.text = "Jogar de novo?"; // _playerDownButton.gameObject.SetActive(true); ChangeStateTo(GameState.Default); } }