private void SelectSecondaryWeapon(PlayerInput input, SecondaryWeapon weapon, bool silent = false)
        {
            if (weapon == selectedSecondaryWeapon)
            {
                //Debug.LogFormat("Secondary weapon '{0}' already selected.", weapon);
                return;
            }

            if (selectedLeftSecondaryWeapon != null)
                selectedLeftSecondaryWeapon.OnDeselect();

            if (selectedRightSecondaryWeapon != null)
                selectedRightSecondaryWeapon.OnDeselect();

            switch (weapon)
            {
                case SecondaryWeapon.None:
                    selectedLeftSecondaryWeapon = null;
                    selectedRightSecondaryWeapon = null;
                    leftWeaponIndicatorIcon.enabled = false;
                    leftWeaponIndicatorNoneIcon.enabled = true;
                    leftWeaponIndicatorInfiniteIcon.enabled = false;
                    leftWeaponIndicatorAmmoLabel.enabled = false;
                    TurnLockingSystemOff();
                    break;

                case SecondaryWeapon.UnguidedMissiles:
                    selectedLeftSecondaryWeapon = leftUnguidedMissileCannon;
                    selectedRightSecondaryWeapon = rightUnguidedMissileCannon;
                    leftWeaponIndicatorIcon.sprite = unguidedMissilesIcon;
                    leftWeaponIndicatorIcon.enabled = true;
                    leftWeaponIndicatorNoneIcon.enabled = false;
                    leftWeaponIndicatorInfiniteIcon.enabled = false;
                    leftWeaponIndicatorAmmoLabel.enabled = true;
                    TurnLockingSystemOff();
                    break;

                case SecondaryWeapon.GuidedMissiles:
                    selectedLeftSecondaryWeapon = leftGuidedMissileCannon;
                    selectedRightSecondaryWeapon = rightGuidedMissileCannon;
                    leftWeaponIndicatorIcon.sprite = guidedMissilesIcon;
                    leftWeaponIndicatorIcon.enabled = true;
                    leftWeaponIndicatorNoneIcon.enabled = false;
                    leftWeaponIndicatorInfiniteIcon.enabled = false;
                    leftWeaponIndicatorAmmoLabel.enabled = true;
                    TurnLockingSystemOn();
                    break;

                default:
                    throw new Exception("Unexpected PrimaryWeapon.");
            }

            if (selectedLeftSecondaryWeapon != null)
                selectedLeftSecondaryWeapon.OnSelect(input);

            if (selectedRightSecondaryWeapon != null)
                selectedRightSecondaryWeapon.OnSelect(input);

            selectedSecondaryWeapon = weapon;
        }
        private void SelectPrimaryWeapon(PlayerInput input, PrimaryWeapon weapon, bool silent = false)
        {
            if (weapon == selectedPrimaryWeapon)
            {
                //Debug.LogFormat("Primary weapon '{0}' already selected.", weapon);
                return;
            }

            if (selectedLeftPrimaryWeapon != null)
                selectedLeftPrimaryWeapon.OnDeselect();

            if (selectedRightPrimaryWeapon != null)
                selectedRightPrimaryWeapon.OnDeselect();

            switch (weapon)
            {
                case PrimaryWeapon.None:
                    selectedLeftPrimaryWeapon = null;
                    selectedRightPrimaryWeapon = null;
                    rightWeaponIndicatorIcon.enabled = false;
                    rightWeaponIndicatorNoneIcon.enabled = true;
                    rightWeaponIndicatorInfiniteIcon.enabled = false;
                    rightWeaponIndicatorAmmoLabel.enabled = false;
                    break;

                case PrimaryWeapon.PlasmaGun:
                    selectedLeftPrimaryWeapon = leftPlasmaGun;
                    selectedRightPrimaryWeapon = rightPlasmaGun;
                    rightWeaponIndicatorIcon.sprite = plasmaGunIcon;
                    rightWeaponIndicatorIcon.enabled = true;
                    rightWeaponIndicatorNoneIcon.enabled = false;
                    rightWeaponIndicatorInfiniteIcon.enabled = true;
                    rightWeaponIndicatorAmmoLabel.enabled = false;
                    break;

                case PrimaryWeapon.Laser:
                    selectedLeftPrimaryWeapon = leftLaser;
                    selectedRightPrimaryWeapon = rightLaser;
                    rightWeaponIndicatorIcon.sprite = laserIcon;
                    rightWeaponIndicatorIcon.enabled = true;
                    rightWeaponIndicatorNoneIcon.enabled = false;
                    rightWeaponIndicatorInfiniteIcon.enabled = false;
                    rightWeaponIndicatorAmmoLabel.enabled = true;
                    break;

                default:
                    throw new Exception("Unexpected PrimaryWeapon.");
            }

            if (selectedLeftPrimaryWeapon != null)
                selectedLeftPrimaryWeapon.OnSelect(input);

            if (selectedRightPrimaryWeapon != null)
                selectedRightPrimaryWeapon.OnSelect(input);

            selectedPrimaryWeapon = weapon;
        }