Example #1
0
        void TakeAmmo()
        {
            AssaultRifle Rifle = rifle.GetComponent <AssaultRifle>();

            Rifle.currentRifleAmmo += quantity;
            if (Rifle.currentRifleAmmo > Rifle.maxRifleAmmo)
            {
                Rifle.currentRifleAmmo = Rifle.maxRifleAmmo;
            }
            Rifle.SetUI();
            Destroy(gameObject);
        }