This commit is contained in:
2026-06-02 08:27:25 +07:00
5 changed files with 175 additions and 191 deletions

View File

@@ -357,6 +357,14 @@ namespace Invector.vCharacterController
}
muzzlePosition = Vector3.forward * cc._capsuleCollider.radius * 2;
muzzleForward = Vector3.forward;
if (inputReader != null)
{
inputReader.OnReloadEvent += () =>
{
if (!isReloading) shooterManager.ReloadWeapon();
};
inputReader.OnSwitchSideEvent += SwitchCameraSide;
}
}
@@ -379,7 +387,7 @@ namespace Invector.vCharacterController
// We change the Melee Attack Input for the Shooter because 'Mouse1' is the same input to Shot a Fire Weapon
weakAttackInput = new GenericInput("Mouse2", "RB", "RB");
// By default it's disable because it uses the same input as the switchCameraSideInput
strafeInput.useInput = false;
// strafeInput.useInput = false;
}
/// <summary>
@@ -666,7 +674,11 @@ namespace Invector.vCharacterController
}
// reset the aimTimming if you sprint while still aiming through the hipfire
if (sprintInput.GetButtonDown() && _aimTiming > 0f)
// if (sprintInput.GetButtonDown() && _aimTiming > 0f)
// {
// _aimTiming = 0f;
// }
if(inputReader.IsSprintHeld && _aimTiming > 0f)
{
_aimTiming = 0f;
}
@@ -692,8 +704,7 @@ namespace Invector.vCharacterController
if (!cc.isRolling)
{
isAimingByInput = (!isReloading || shooterManager.keepAimingWhenReload) && (aimInput.GetButton() || (shooterManager.alwaysAiming && CurrentActiveWeapon)) && !cc.ragdolled && !cc.customAction
|| (cc.customAction && cc.isJumping);
isAimingByInput = (!isReloading || shooterManager.keepAimingWhenReload) && (inputReader.IsAimHeld || (shooterManager.alwaysAiming && CurrentActiveWeapon)) && !cc.ragdolled && !cc.customAction;
}
if (aimInput.GetButtonUp() && !shotInput.GetButton())
@@ -774,7 +785,8 @@ namespace Invector.vCharacterController
{
if (CurrentActiveWeapon || (shooterManager.CurrentWeapon && shooterManager.hipfireShot))
{
HandleShotCount(shooterManager.CurrentWeapon, shotInput.GetButton());
// HandleShotCount(shooterManager.CurrentWeapon, shotInput.GetButton());
HandleShotCount(shooterManager.CurrentWeapon, inputReader.IsAttackHeld);
}
}
else if (!IsAiming)