update
This commit is contained in:
@@ -24,18 +24,6 @@ namespace Invector.vCharacterController
|
||||
[vHelpBox("PC only - use it to toggle between run/walk", vHelpBoxAttribute.MessageType.Info)]
|
||||
public KeyCode toggleWalk = KeyCode.CapsLock;
|
||||
|
||||
[Header("Movement Input")]
|
||||
|
||||
|
||||
|
||||
// public GenericInput horizontalInput = new GenericInput("Horizontal", "LeftAnalogHorizontal", "Horizontal");
|
||||
// public GenericInput verticalInput = new GenericInput("Vertical", "LeftAnalogVertical", "Vertical");
|
||||
// public GenericInput sprintInput = new GenericInput("LeftShift", "LeftStickClick", "LeftStickClick");
|
||||
// public GenericInput crouchInput = new GenericInput("C", "Y", "Y");
|
||||
// public GenericInput strafeInput = new GenericInput("Tab", "RightStickClick", "RightStickClick");
|
||||
// public GenericInput jumpInput = new GenericInput("Space", "X", "X");
|
||||
// public GenericInput rollInput = new GenericInput("Q", "B", "B");
|
||||
|
||||
[Header("New Input System")]
|
||||
public InputReader inputReader;
|
||||
|
||||
@@ -45,12 +33,6 @@ namespace Invector.vCharacterController
|
||||
[vEditorToolbar("Camera Settings")]
|
||||
public bool lockCameraInput;
|
||||
public bool invertCameraInputVertical, invertCameraInputHorizontal;
|
||||
// [vEditorToolbar("Inputs")]
|
||||
[Header("Camera Input")]
|
||||
// public GenericInput rotateCameraXInput = new GenericInput("Mouse X", "RightAnalogHorizontal", "Mouse X");
|
||||
// public GenericInput rotateCameraYInput = new GenericInput("Mouse Y", "RightAnalogVertical", "Mouse Y");
|
||||
// public GenericInput cameraZoomInput = new GenericInput("Mouse ScrollWheel", "", "");
|
||||
|
||||
[vEditorToolbar("Events")]
|
||||
public UnityEvent OnLockCamera;
|
||||
public UnityEvent OnUnlockCamera;
|
||||
@@ -144,33 +126,6 @@ namespace Invector.vCharacterController
|
||||
ShowCursor(showCursorOnStart);
|
||||
LockCursor(unlockCursorOnStart);
|
||||
EnableOnAnimatorMove();
|
||||
if (inputReader != null)
|
||||
{
|
||||
// Nhảy (Jump)
|
||||
inputReader.OnJumpEvent += () =>
|
||||
{
|
||||
if (JumpConditions()) cc.Jump(true);
|
||||
};
|
||||
|
||||
// Lộn vòng (Roll / Dodge)
|
||||
inputReader.OnDodgeEvent += () =>
|
||||
{
|
||||
if (RollConditions()) cc.Roll();
|
||||
};
|
||||
|
||||
// Ngồi (Crouch)
|
||||
inputReader.OnCrouchEvent += () =>
|
||||
{
|
||||
cc.AutoCrouch();
|
||||
cc.Crouch();
|
||||
};
|
||||
|
||||
// Đổi góc nhìn hoặc Khóa mục tiêu (Strafe) - Tuỳ bạn map nút nào vào OnToggleViewEvent
|
||||
inputReader.OnToggleViewEvent += () =>
|
||||
{
|
||||
cc.Strafe();
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual IEnumerator CharacterInit()
|
||||
@@ -530,18 +485,14 @@ namespace Invector.vCharacterController
|
||||
|
||||
public virtual void StrafeInput()
|
||||
{
|
||||
// if (strafeInput.GetButtonDown())
|
||||
// {
|
||||
// cc.Strafe();
|
||||
// }
|
||||
if (inputReader != null && inputReader.ConsumeToggleView())
|
||||
{
|
||||
cc.Strafe();
|
||||
}
|
||||
}
|
||||
|
||||
public virtual void SprintInput()
|
||||
{
|
||||
// if (sprintInput.useInput)
|
||||
// {
|
||||
// cc.Sprint(cc.useContinuousSprint ? sprintInput.GetButtonDown() : sprintInput.GetButton());
|
||||
// }
|
||||
if (inputReader == null) return;
|
||||
cc.Sprint(inputReader.IsSprintHeld);
|
||||
}
|
||||
@@ -550,10 +501,10 @@ namespace Invector.vCharacterController
|
||||
{
|
||||
cc.AutoCrouch();
|
||||
|
||||
// if (crouchInput.useInput && crouchInput.GetButtonDown())
|
||||
// {
|
||||
// cc.Crouch();
|
||||
// }
|
||||
if (inputReader != null && inputReader.ConsumeCrouch())
|
||||
{
|
||||
cc.Crouch();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -570,10 +521,10 @@ namespace Invector.vCharacterController
|
||||
/// </summary>
|
||||
public virtual void JumpInput()
|
||||
{
|
||||
// if (jumpInput.GetButtonDown() && JumpConditions())
|
||||
// {
|
||||
// cc.Jump(true);
|
||||
// }
|
||||
if (inputReader != null && inputReader.ConsumeJump() && JumpConditions())
|
||||
{
|
||||
cc.Jump(true);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -590,10 +541,10 @@ namespace Invector.vCharacterController
|
||||
/// </summary>
|
||||
public virtual void RollInput()
|
||||
{
|
||||
// if (rollInput.GetButtonDown() && RollConditions())
|
||||
// {
|
||||
// cc.Roll();
|
||||
// }
|
||||
if (inputReader != null && inputReader.ConsumeDodge() && RollConditions())
|
||||
{
|
||||
cc.Roll();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
Reference in New Issue
Block a user