Skip to content

Commit

Permalink
reset TTSSystem.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
SpicyDarkFox authored Sep 21, 2024
1 parent 757038a commit 1bda9a9
Showing 1 changed file with 1 addition and 18 deletions.
19 changes: 1 addition & 18 deletions Content.Client/Corvax/TTS/TTSSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ public sealed class TTSSystem : EntitySystem

private float _volume = 0f;
private int _fileIdx = 0;
private Dictionary<ResPath, float> _filesToDelete = new();

public override void Initialize()
{
Expand All @@ -57,21 +56,6 @@ public override void Initialize()
SubscribeNetworkEvent<PlayTTSEvent>(OnPlayTTS);
}

public override void Update(float frameTime)
{
base.Update(frameTime);

if (_filesToDelete.Count > 0)
foreach (var key in _filesToDelete.Keys)
{
_filesToDelete[key] -= frameTime;
if (_filesToDelete[key] <= 0)
{
_filesToDelete.Remove(key);
}
}
}

public override void Shutdown()
{
base.Shutdown();
Expand Down Expand Up @@ -130,8 +114,7 @@ private void OnPlayTTS(PlayTTSEvent ev)
_audio.PlayGlobal(soundPath, Filter.Local(), false);
}

_filesToDelete.Add(filePath, 50); //удаление файла отложено на 50 секунд (приблизительно)
//_contentRoot.RemoveFile(filePath);
_contentRoot.RemoveFile(filePath);
}

private float AdjustVolume(bool isWhisper)
Expand Down

0 comments on commit 1bda9a9

Please sign in to comment.