void Update() { if (!started) { return; } if (Input.GetButtonDown("RedPuppet")) { if (ammo.CanFire(true)) { ammo.Fire(true); } else { if (!RedReloading) { RedReloading = true; ammo.AddBullet(true); } } } if (Input.GetButtonUp("RedPuppet")) { if (!ammo.CanFire(true) && RedReloading) { RedReloading = false; ammo.RemoveBullet(true); } } if (Input.GetButtonDown("BluePuppet")) { if (ammo.CanFire(false)) { ammo.Fire(false); } else { if (!BlueReloading) { BlueReloading = true; ammo.AddBullet(false); } } } if (Input.GetButtonUp("BluePuppet")) { if (!ammo.CanFire(false) && BlueReloading) { BlueReloading = false; ammo.RemoveBullet(false); } } }
private bool NeedsReload(bool red) { return(!AmmoScript.CanFire(red)); }