Fixed an issue wit the server room alarm being restarted when button pushed during alarm

This commit is contained in:
mxssw 2025-05-22 18:38:48 +03:00
parent ffd98b6322
commit d3f41bd245

View File

@ -23,9 +23,12 @@ public class AlarmTrigger : MonoBehaviour
void OnButtonPressed() void OnButtonPressed()
{ {
Debug.Log("Alarm button Pressed!"); Debug.Log("Alarm button Pressed!");
VentilationSequence.Stop();
AlarmSequence.Play(); if (!AlarmSequence.isPlaying) { //if alarm isn't already triggered.
hasAlarm = true; VentilationSequence.Stop();
AlarmSequence.Play();
hasAlarm = true;
}
} }
void Update() void Update()
{ {