void LaserLogic() { if (Input.GetButton(Constants.CROSSHAIR_LASER_INPUT)) { laserLeft -= laserReductionSpeed * Time.deltaTime; if (laserLeft > 0) { laser.Fire(); alienLasor.setParameterValue("buttonHold", 1); CheckIfLaserHitAnything(); } else { // alienLasor.setParameterValue("buttonHold", 0); } } else { laserLeft += laserChargingSpeed * Time.deltaTime; } laserBarUi.ShowPercentageOfElement(laserLeft); }