mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-03 22:25:54 +00:00
27 lines
630 B
C#
27 lines
630 B
C#
|
|
using Godot;
|
|||
|
|
|
|||
|
|
namespace Cirno.Scripts.Actors._3D;
|
|||
|
|
|
|||
|
|
public partial class AlarmSoundPlayer3D : AudioStreamPlayer3D
|
|||
|
|
{
|
|||
|
|
public override void _Ready()
|
|||
|
|
{
|
|||
|
|
if (AlarmManager.Instance is not null)
|
|||
|
|
{
|
|||
|
|
this.Stream = AlarmManager.Instance.AlarmSound;
|
|||
|
|
|
|||
|
|
AlarmManager.Instance.AlarmEnabled3D += InstanceOnAlarmEnabled3D;
|
|||
|
|
AlarmManager.Instance.AlarmDisabled += InstanceOnAlarmDisabled;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
private void InstanceOnAlarmDisabled()
|
|||
|
|
{
|
|||
|
|
this.Stop();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
private void InstanceOnAlarmEnabled3D(Vector3 location)
|
|||
|
|
{
|
|||
|
|
this.Play();
|
|||
|
|
}
|
|||
|
|
}
|