This commit is contained in:
CortexCore
2024-03-24 02:05:16 +08:00
parent bfc869d19e
commit 65d90d1bfa
48 changed files with 7433 additions and 7600 deletions

View File

@@ -29,6 +29,8 @@ namespace BITFALL.Guns.States
private bool boltActionImmediately;
private AnimancerState inspectState;
private AnimancerState crouchState;
public override void OnStateEntry(IState old)
{
switch (old)
@@ -38,6 +40,7 @@ namespace BITFALL.Guns.States
break;
default:
PlayAnimation();
OnMovementStateChanged(null, _entityMovement.CurrentState);
break;
}
_selector.OnActive += OnActive;
@@ -113,7 +116,7 @@ namespace BITFALL.Guns.States
public void OnActive(ISelectable selectable)
{
//root.animator.Play(BITConstant.Player.Interactive);
PlayAnimation(SearchKey.Append(nameof(BITConstant.Player.Interactive)).ToArray());
PlayAnimation(root.SearchKey.Append(nameof(BITConstant.Player.Interactive)).ToArray());
}
public override void OnMovementStateChanged(IEntityMovementState old, IEntityMovementState newState)
{
@@ -121,11 +124,22 @@ namespace BITFALL.Guns.States
if (newState is IPlayerSlideState)
{
root.TransitionState<Movement>();
PlayAnimation(SearchKey.Append(nameof(BITConstant.Player.Slide)).ToArray());
PlayAnimation(root.SearchKey.Append(nameof(BITConstant.Player.Slide)).ToArray());
//root.animator.CrossFade(BITConstant.Player.Slide, 0.32f);
}else if (Enabled && newState is IPlayerDodgeState)
}else if (newState is IPlayerDodgeState)
{
PlayAnimation(SearchKey.Append(nameof(BITConstant.Player.Dodge)).ToArray());
PlayAnimation(root.SearchKey.Append(nameof(BITConstant.Player.Dodge)).ToArray());
}else if (Enabled)
{
switch (newState)
{
case IPlayerCrouchState:
PlayAnimation(root.SearchKey.Append(nameof(BITConstant.Player.Crouch)).ToArray());
break;
case IPlayerMovementState:
PlayAnimation();
break;
}
}
}
}
@@ -136,7 +150,7 @@ namespace BITFALL.Guns.States
private ExpectState<bool> _expectSprint;
public override void OnStateEntry(IState old)
{
PlayAnimation(SearchKey.Append(nameof(BITConstant.Player.Run)).ToArray());
PlayAnimation(root.SearchKey.Append(nameof(BITConstant.Player.Run)).ToArray());
root.inputActionGroup.RegisterCallback(root.aimAction, OnAim);
}
@@ -181,7 +195,7 @@ namespace BITFALL.Guns.States
public override void OnStateEntry(IState old)
{
//root.animator.CrossFade(BITConstant.Player.Sprint, 0.32f);
PlayAnimation(SearchKey.Append(nameof(BITConstant.Player.Sprint)).ToArray());
PlayAnimation(root.SearchKey.Append(nameof(BITConstant.Player.Sprint)).ToArray());
root.inputActionGroup.RegisterCallback(root.aimAction, OnAim);
}
@@ -218,10 +232,10 @@ namespace BITFALL.Guns.States
case IPlayerRunState:
case IPlayerSprintState:
//root.animator.CrossFade(BITConstant.Player.Aim, 0.32f);
PlayAnimation(SearchKey.Append(nameof(BITConstant.Player.Aim)).ToArray());
PlayAnimation(root.SearchKey.Append(nameof(BITConstant.Player.Aim)).ToArray());
break;
default:
PlayAnimation(SearchKey.Append(nameof(BITConstant.Player.Aim)).ToArray());
PlayAnimation(root.SearchKey.Append(nameof(BITConstant.Player.Aim)).ToArray());
break;
}
_entityMovement.ExecuteCommand<PlayerPauseRunCommand>(new(this,true));