Example #1
0
    // Update is called once per frame
    void Update()
    {
        int currentLives = zombieController.GetLives();

        if (currentLives == 2)
        {
            heart2.GetComponent <SpriteRenderer>().enabled = false;
        }
        else if (currentLives == 1)
        {
            heart1.GetComponent <SpriteRenderer>().enabled = false;
        }
        else if (currentLives == 0)
        {
            heart0.GetComponent <SpriteRenderer>().enabled = false;
        }
    }