1
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using System.Data.Odbc;
|
||||
using BITFALL.Player.Movement;
|
||||
using BITKit;
|
||||
using BITKit.Entities;
|
||||
@@ -44,6 +45,8 @@ namespace BITFALL.Guns.States
|
||||
{
|
||||
root.TransitionState<Run>();
|
||||
}
|
||||
|
||||
root.expectAiming.shouldBe = root.aimAction.action.IsPressed();
|
||||
}
|
||||
public void OnHover(ISelectable selectable)
|
||||
{
|
||||
@@ -190,10 +193,9 @@ namespace BITFALL.Guns.States
|
||||
public override void OnMovementStateChanged(IEntityMovementState old, IEntityMovementState newState)
|
||||
{
|
||||
if (Enabled is false) return;
|
||||
if(newState is IPlayerRunState or IPlayerSprintState)
|
||||
{
|
||||
root.TransitionState<Movement>();
|
||||
}
|
||||
if (newState is not (IPlayerRunState or IPlayerSprintState)) return;
|
||||
root.expectAiming.Reset();
|
||||
root.TransitionState<Movement>();
|
||||
}
|
||||
}
|
||||
[System.Serializable]
|
||||
@@ -281,7 +283,14 @@ namespace BITFALL.Guns.States
|
||||
public override void OnStateEntry(IState old)
|
||||
{
|
||||
root.animator.Play(BITGun._Melee);
|
||||
_entityMovement.ExecuteCommand(new PlayerDisableRunCommand(this));
|
||||
}
|
||||
|
||||
public override void OnStateExit(IState old, IState newState)
|
||||
{
|
||||
_entityMovement.ExecuteCommand(new PlayerEnableRunCommand(this));
|
||||
}
|
||||
|
||||
public override void OnStateUpdate(float deltaTime)
|
||||
{
|
||||
_entityMovement.ExecuteCommand<PlayerCancelRunCommand>();
|
||||
|
Reference in New Issue
Block a user