public bool HandleShootInputs(bool inputDown, bool inputHeld, bool inputUp) { m_wantsToShoot = inputDown || inputHeld; switch (shootType) { case WeaponShootType.Manual: if (owner.name == "Player") { //record the data if (inputDown) { m_dr.AddTiming(m_gm.m_playerBeatAccuracy, m_gm.m_inTime, m_gm.m_score); } if (inputDown && m_gm.m_inTime) { return(TryShoot()); } else if (inputDown && !m_gm.m_inTime) { //overheat the weapon if we're out of time with the music UseAmmo(m_CurrentAmmo); } } else if (inputDown) { return(TryShoot()); } return(false); case WeaponShootType.Automatic: //if input is down in time, start shooting if (owner.name == "Player") { //record the data if (inputDown) { m_dr.AddTiming(m_gm.m_playerBeatAccuracy, m_gm.m_inTime, m_gm.m_score); } if (inputDown && m_gm.m_inTime) { m_shooting = true; } else if (inputDown && !m_gm.m_inTime) { //overheat the weapon if we're out of time with the music UseAmmo(m_CurrentAmmo); } if (inputHeld && m_shooting) { return(TryShoot()); } if (inputUp) { m_shooting = false; } } else if (inputHeld) { return(TryShoot()); } return(false); case WeaponShootType.Charge: if (owner.name == "Player") { //record the data if (inputDown || inputUp) { m_dr.AddTiming(m_gm.m_playerBeatAccuracy, m_gm.m_inTime, m_gm.m_score); } if (inputDown && m_gm.m_inTime) { m_shooting = true; } else if (inputDown && !m_gm.m_inTime) { //overheat the weapon if we're out of time with the music UseAmmo(m_CurrentAmmo); } if (inputHeld && m_shooting) { TryBeginCharge(); } } else if (inputHeld) { TryBeginCharge(); } if (owner.name == "Player") { if (inputUp && m_gm.m_inTime) { return(TryReleaseCharge()); } else if (inputUp && !m_gm.m_inTime) { UseAmmo(m_CurrentAmmo); } else if (automaticReleaseOnCharged && currentCharge >= 1f) { return(TryReleaseCharge()); } } // Check if we released charge or if the weapon shoot autmatically when it's fully charged if (inputUp || (automaticReleaseOnCharged && currentCharge >= 1f)) { return(TryReleaseCharge()); } return(false); default: return(false); } }