Example #1
0
    protected void Fire()
    {
        if (ammoManager.HasAmmo(tag))
        {
            fireBullet();
            //play sound
            GetComponent <AudioSource>().PlayOneShot(liveFire);
            ammoManager.ConsumeAmmo(tag);
            UpdateAmmoText();
        }
        else
        {
            GetComponent <AudioSource>().PlayOneShot(dryFire);
        }

        GetComponentInChildren <Animator>().Play("Fire");

        // Debug.Log("Fire");
    }