Отображение в редакторе при изменении экспортированных переменных, музыка на все дни, звуки дверей, NPC.

This commit is contained in:
Евгений Титаренко 2024-08-18 16:22:44 +03:00
parent fec3f22665
commit 3c1619ee9f
47 changed files with 657 additions and 89 deletions

View file

@ -4,6 +4,8 @@ using Godot;
public partial class AudioCollection : Node
{
[Signal] public delegate void FinishedEventHandler();
private enum State
{
Error,
@ -46,6 +48,7 @@ public partial class AudioCollection : Node
if (!_currentPlayer.IsPlaying())
{
_state = State.Timeout;
EmitSignal(SignalName.Finished);
}
break;
@ -72,7 +75,7 @@ public partial class AudioCollection : Node
player.PitchScale = RandomPitch ? _rng.RandfRange(PitchStart, PitchEnd) : 1;
player.Play();
_state = State.Playing;
_currentChild = Shuffle ? _rng.RandiRange(0, _count) : 0;
_currentChild = Shuffle ? _rng.RandiRange(0, _count) : (_currentChild + 1) % _count;
_currentPlayer = player;
break;
}