Esempio n. 1
0
    // Update is called once per frame
    void Update()
    {
        if (IsMyTurn)
        {
            if (this.IsOver)
            {
                if (!timesUpEffect.GetActive())
                {
                    timesUpEffect.SetActive(true);
                }
                else
                {
                    timesUpEffect.GetComponent <ParticleSystem>().Play();
                }

                SwitchTurn();
            }

            timeLeftObj.text = RemainingSecondsInTurn.ToString("F2");
        }

        if (PhotonNetwork.room.GetWhoseTurn() == PhotonNetwork.player.UserId)
        {
            turnObj.text = "Your Turn";
        }
        else
        {
            turnObj.text = "Your Opponent Turn";
        }

        roundTimerObj.text = "Ending In: " + RemainingTimeInRound.ToString("F2");
    }
Esempio n. 2
0
    void SetupGUI()
    {
        // Set GUI
        //if (GameObject.Find("IGN").GetComponent<Text>())
        //{
        //    playerIGNObj = GameObject.Find("IGN").GetComponent<Text>();
        //    playerIGNObj.text = PhotonNetwork.player.UserId;
        //}

        //if (GameObject.Find("EnemyIGN").GetComponent<Text>())
        //{
        //    enemyIGNObj = GameObject.Find("EnemyIGN").GetComponent<Text>();

        //    for (int i = 0; i < playerList.Length; i++)
        //    {
        //        if (playerList[i].UserId != PhotonNetwork.player.UserId)
        //            enemyIGNObj.text = playerList[i].UserId;
        //    }

        //}

        if (GameObject.Find("RoundTimer").GetComponent <Text>())
        {
            roundTimerObj = GameObject.Find("RoundTimer").GetComponent <Text>();
        }

        if (GameObject.Find("TurnIndicator").GetComponent <Text>())
        {
            turnObj      = GameObject.Find("TurnIndicator").GetComponent <Text>();
            turnObj.text = PhotonNetwork.room.GetWhoseTurn() + " Turn";
        }

        if (GameObject.Find("TimeLeft").GetComponent <Text>())
        {
            timeLeftObj      = GameObject.Find("TimeLeft").GetComponent <Text>();
            timeLeftObj.text = RemainingSecondsInTurn.ToString();
        }
    }