Exemplo n.º 1
0
        public void onGameOver(bool vic)
        {
            if (pauseButton)
            {
                pauseButton.SetActive(false);
            }

            DartGameScript gameScript = (DartGameScript)GameObject.FindObjectOfType(typeof(DartGameScript));

            if (gameScript)
            {
                if (gameScript.getNomPlayers() == 1)
                {
                    winnerLabel.text = "GAMEOVER";
                }
                else
                {
                    string winner = "No one wins!";
                    if (vic)
                    {
                        winner = "Player 1 Wins!";
                    }
                    else
                    {
                        winner = "Player 2 Wins!";
                    }
                    winnerLabel.text = winner;
                }
            }
            if (gameoverPanel)
            {
                gameoverPanel.SetActive(true);
            }
        }
Exemplo n.º 2
0
 void Awake()
 {
     m_rotator    = gameObject.GetComponent <Rotator>();
     m_initalPos  = transform.position;
     m_initalRot  = transform.rotation;
     m_gameScript = (DartGameScript)GameObject.FindObjectOfType(typeof(DartGameScript));
     m_dartBoard  = (DartBoard)GameObject.FindObjectOfType(typeof(DartBoard));
 }
Exemplo n.º 3
0
        void updateNomPlayers()
        {
            BasePlayer[]   players = (BasePlayer[])GameObject.FindObjectsOfType(typeof(BasePlayer));
            DartGameScript bk      = (DartGameScript)GameObject.FindObjectOfType(typeof(DartGameScript));

            if (bk)
            {
                bk.setNomPlayers(players.Length);
            }
        }