mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-01 08:35:34 +00:00
19 lines
No EOL
444 B
C#
19 lines
No EOL
444 B
C#
using Cirno.Scripts.Components.Actors;
|
|
using Godot;
|
|
|
|
namespace Cirno.Scripts.Components.FSM.Player;
|
|
|
|
public partial class HurtSoundPlayer : AudioStreamPlayer2D
|
|
{
|
|
[Export] public PlayerDamageReceiver DamageReceiver { get; private set; }
|
|
|
|
public override void _Ready()
|
|
{
|
|
DamageReceiver.HealthDecreased += OnHurt;
|
|
}
|
|
|
|
private void OnHurt(float value, float newValue, float maxValue)
|
|
{
|
|
this.Play();
|
|
}
|
|
} |