mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-01 10:35:34 +00:00
3D Cameras with sweep and animation
This commit is contained in:
parent
4cc7a0c004
commit
7e76edc153
48 changed files with 3211 additions and 1511 deletions
|
|
@ -23,20 +23,25 @@ public partial class AlarmManager : Node
|
|||
[Signal]
|
||||
public delegate void AlarmDisabledEventHandler();
|
||||
|
||||
private AudioStreamPlayer2D _player;
|
||||
//private AudioStreamPlayer _player;
|
||||
|
||||
public override void _Ready()
|
||||
{
|
||||
Instance = this;
|
||||
|
||||
if (AlarmSound is not null)
|
||||
{
|
||||
var player = new AudioStreamPlayer2D();
|
||||
player.Stream = AlarmSound;
|
||||
this.CallDeferred("add_child", player);
|
||||
|
||||
_player = player;
|
||||
}
|
||||
// if (AlarmSound is not null)
|
||||
// {
|
||||
// var player = GetNodeOrNull<AudioStreamPlayer>("AlarmSoundPlayer");
|
||||
// if (player is not null)
|
||||
// {
|
||||
// player.Stream = AlarmSound;
|
||||
// _player = player;
|
||||
// }
|
||||
//
|
||||
// //this.CallDeferred("add_child", player);
|
||||
//
|
||||
//
|
||||
// }
|
||||
}
|
||||
|
||||
public void SoundAlarm(Vector2 location)
|
||||
|
|
@ -47,7 +52,7 @@ public partial class AlarmManager : Node
|
|||
EmitSignalAlarmEnabled(location);
|
||||
|
||||
GD.Print($"Alarm sounded at {location}");
|
||||
_player?.Play();
|
||||
//_player?.Play();
|
||||
}
|
||||
|
||||
public void SoundAlarm(Vector3 location)
|
||||
|
|
@ -58,7 +63,7 @@ public partial class AlarmManager : Node
|
|||
EmitSignalAlarmEnabled3D(location);
|
||||
|
||||
GD.Print($"Alarm sounded at {location}");
|
||||
_player?.Play();
|
||||
//_player?.Play();
|
||||
}
|
||||
|
||||
public void SoundSilentAlarm(Vector2 location)
|
||||
|
|
@ -71,6 +76,6 @@ public partial class AlarmManager : Node
|
|||
{
|
||||
IsAlarmOn = false;
|
||||
EmitSignal(nameof(AlarmDisabled));
|
||||
_player?.Stop();
|
||||
//_player?.Stop();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue