mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-01 09:55:35 +00:00
27 lines
No EOL
630 B
C#
27 lines
No EOL
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();
|
|
}
|
|
} |