Example #1
0
    // what's happen when the player shield is hit by a bullet
    public void shieldHit()
    {
        sound.shieldDestroySound(.5f);       // play the destroy shield  sound
        shield -= 1;                         // decrement the shield value

        if (shield <= 0)                     // condition to reload the shield
        {
            StartCoroutine(reloadShieldC()); // coroutine that reload the shield
        }
    }