Ejemplo n.º 1
0
    void Update()
    {
        m_PlayersCount = counter.GetPlayerCount();

        if (m_PlayersCount == 0)
        {
            firstconnected = true;
        }
        if (m_PlayersCount == 1 && firstconnected == true)
        {
            return;
        }
        else if (m_PlayersCount > 1)
        {
            firstconnected = false;
        }
        else if (m_PlayersCount == 1 && firstconnected == false)
        {
            Text wintext = gameObject.GetComponent <Text> ();
            wintext.text = "You Win!";
        }



        if (isdead && firsttime)
        {
            Text losetext = gameObject.GetComponent <Text> ();
            firsttime     = false;
            losetext.text = "You Lose!";
        }
    }
Ejemplo n.º 2
0
    // Update is called once per frame
    void Update()
    {
        playersCount = counter.GetPlayerCount();

        if (playersCount == 1)
        {
            winText.text = "YOU WIN!";
        }
    }