update Input new in script
This commit is contained in:
@@ -58,6 +58,11 @@ namespace Invector.vCharacterController
|
||||
protected override void Start()
|
||||
{
|
||||
base.Start();
|
||||
if (inputReader != null)
|
||||
{
|
||||
inputReader.OnAttackEvent += TriggerWeakAttack;
|
||||
inputReader.OnStrongAttackEvent += TriggerStrongAttack;
|
||||
}
|
||||
}
|
||||
|
||||
protected override void LateUpdate()
|
||||
@@ -82,9 +87,9 @@ namespace Invector.vCharacterController
|
||||
|
||||
if (MeleeAttackConditions() && !lockMeleeInput)
|
||||
{
|
||||
MeleeWeakAttackInput();
|
||||
MeleeStrongAttackInput();
|
||||
BlockingInput();
|
||||
// MeleeWeakAttackInput();
|
||||
// MeleeStrongAttackInput();
|
||||
// BlockingInput();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -149,7 +154,8 @@ namespace Invector.vCharacterController
|
||||
return;
|
||||
}
|
||||
|
||||
isBlocking = blockInput.GetButton() && cc.currentStamina > 0 && !cc.customAction && !isAttacking;
|
||||
// isBlocking = blockInput.GetButton() && cc.currentStamina > 0 && !cc.customAction && !isAttacking;
|
||||
isBlocking = inputReader.IsBlockHeld && cc.currentStamina > 0 && !cc.customAction && !isAttacking;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -157,11 +163,13 @@ namespace Invector.vCharacterController
|
||||
/// </summary>
|
||||
public override void SprintInput()
|
||||
{
|
||||
if (sprintInput.useInput)
|
||||
{
|
||||
bool canSprint = cc.useContinuousSprint ? sprintInput.GetButtonDown() : sprintInput.GetButton();
|
||||
cc.Sprint(canSprint && !isAttacking);
|
||||
}
|
||||
// if (sprintInput.useInput)
|
||||
// {
|
||||
// bool canSprint = cc.useContinuousSprint ? sprintInput.GetButtonDown() : sprintInput.GetButton();
|
||||
// cc.Sprint(canSprint && !isAttacking);
|
||||
//}
|
||||
if(inputReader == null) return;
|
||||
cc.Sprint(inputReader.IsSprintHeld && !isAttacking);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
Reference in New Issue
Block a user