mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-11 18:45:53 +00:00
Delay start for animation
This commit is contained in:
parent
1005796e13
commit
a9a7b234fb
9 changed files with 108 additions and 23 deletions
|
|
@ -30,6 +30,8 @@ public partial class Active : PlayerFSMState
|
|||
[Export] private PlayerDamageReceiver _damageReceiver;
|
||||
[Export] private ActivationProvider _activationProvider;
|
||||
|
||||
[Export] private InteractionController _interactionController;
|
||||
|
||||
private bool _isStrafing;
|
||||
|
||||
public int MovementSpeed => _isStrafing ? StrafeSpeed : Speed;
|
||||
|
|
@ -51,16 +53,16 @@ public partial class Active : PlayerFSMState
|
|||
ChangeState(PlayerState.Dead);
|
||||
};
|
||||
|
||||
_damageReceiver.HealthChanged += (value, maxValue) =>
|
||||
_damageReceiver.HealthDecreased += (value, newValue, maxValue) =>
|
||||
{
|
||||
_animationProvider.Blink();
|
||||
_hud.UpdateHealth(value, maxValue);
|
||||
//_hud.UpdateHealth(value, maxValue);
|
||||
};
|
||||
|
||||
_damageReceiver.ShieldChanged += (value, maxValue) =>
|
||||
_damageReceiver.ShieldDecreased += (value, newValue, maxValue) =>
|
||||
{
|
||||
_animationProvider.PlayShieldAnimation();
|
||||
_hud.UpdateShield(value, maxValue);
|
||||
//_hud.UpdateShield(value, maxValue);
|
||||
};
|
||||
|
||||
_damageReceiver.Init();
|
||||
|
|
@ -84,6 +86,7 @@ public partial class Active : PlayerFSMState
|
|||
_animationProvider.ShowSprite();
|
||||
_damageReceiver.Enabled = true;
|
||||
_activationProvider.Enabled = true;
|
||||
_interactionController.Enabled = true;
|
||||
}
|
||||
|
||||
public override void ExitState()
|
||||
|
|
@ -94,6 +97,7 @@ public partial class Active : PlayerFSMState
|
|||
|
||||
_damageReceiver.Enabled = false;
|
||||
_activationProvider.Enabled = false;
|
||||
_interactionController.Enabled = false;
|
||||
}
|
||||
|
||||
public override void PhysicsProcessState(double delta)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue