Ejemplo n.º 1
0
    /// <summary>
    /// Updates the game over logic
    /// </summary>
    void Update()
    {
        UpdateAI();

        if (m_isGameOver)
        {
            UpdateOnGameOver();
        }
        else if (m_network.IsConnectedToLevel())
        {
            if (Input.GetKeyDown(KeyCode.Escape) || forceLoseGame)
            {
                m_hasLostGame = true;
                SetGameOver(true);
            }
            else if (forceWinGame)
            {
                m_hasLostGame = false;
                SetGameOver(true);
            }
            else
            {
                var player = PlayerManager.GetControllablePlayer();
                if (player != null && !player.GetComponent <Health>().IsAlive)
                {
                    m_hasLostGame = true;
                    SetGameOver(true);
                }
            }
        }
    }
Ejemplo n.º 2
0
 /// <summary>
 /// Updates the script
 /// </summary>
 void Update()
 {
     if (!m_network.IsConnectedToLevel())
     {
         GetComponent <UnityEngine.UI.Text>().enabled = true;
         GetComponent <UnityEngine.UI.Text>().text    = "Entering Game" + GetDots();
     }
     else
     {
         GetComponent <UnityEngine.UI.Text>().enabled = false;
     }
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Updates the script
 /// </summary>
 void Update()
 {
     if (!m_network.IsConnectedToLevel())
     {
         GetComponent <UnityEngine.UI.Text>().enabled = true;
         GetComponent <UnityEngine.UI.Text>().text    = m_network.GetNetworkStatus();
     }
     else
     {
         GetComponent <UnityEngine.UI.Text>().enabled = false;
     }
 }