// Update is called once per frame void FixedUpdate() { if (_active && _fireControl != null) { Shoot(_fireControl.ShouldShoot(_targetChoosingMechanism.CurrentTarget)); } }
// FixedUpdate is called once per phisics time step void FixedUpdate() { if (_active && _fireControl != null && _beams != null) { _shootingTime = _fireControl.ShouldShoot() ? KeepShootingSeconds : _shootingTime -= Time.fixedDeltaTime; Shoot(_shootingTime >= 0); } else { foreach (var beam in _beams) { beam.TurnOff(); } //scrub the list now they've all been turned off. _beams = new List <Beam>(); } }