Esempio n. 1
0
    // Update is called once per frame
    void Update()
    {
        BabyCowScript player = FindObjectOfType <BabyCowScript>();

        if (player != null)
        {
            my_text.text = "" + player.GetScore();
        }
    }
Esempio n. 2
0
    // Update is called once per frame
    void Update()
    {
        BabyCowScript player = FindObjectOfType <BabyCowScript>();

        if (player != null)
        {
            my_text.text = "" + player.GetHealth();
        }
        else
        {
            my_text.text = "0";
            var gameOver = FindObjectOfType <GameOver>();
            if (!gameOver.isShown())
            {
                gameOver.FarmerWins();
            }
        }
    }