void Update()
{
currentWeapon = weaponManager.GetCurrentWeapon();
if (PauseMenu.IsOn)
return;
if (currentWeapon.bullets < currentWeapon.maxBullets)
{
if (Input.GetButtonDown("Reload"))
{
weaponManager.Reload();
return;
}
}
if (currentWeapon.fireRate <= 0f)
{
if (Input.GetButtonDown("Fire1"))
{
Shoot();
}
} else
{
if (Input.GetButtonDown("Fire1"))
{
InvokeRepeating("Shoot", 0f, 1f/currentWeapon.fireRate);
} else if (Input.GetButtonUp ("Fire1"))
{
CancelInvoke("Shoot");
}
}
}