Fixed an issue wit the server room alarm being restarted when button pushed during alarm
This commit is contained in:
parent
ffd98b6322
commit
d3f41bd245
@ -23,10 +23,13 @@ public class AlarmTrigger : MonoBehaviour
|
|||||||
void OnButtonPressed()
|
void OnButtonPressed()
|
||||||
{
|
{
|
||||||
Debug.Log("Alarm button Pressed!");
|
Debug.Log("Alarm button Pressed!");
|
||||||
|
|
||||||
|
if (!AlarmSequence.isPlaying) { //if alarm isn't already triggered.
|
||||||
VentilationSequence.Stop();
|
VentilationSequence.Stop();
|
||||||
AlarmSequence.Play();
|
AlarmSequence.Play();
|
||||||
hasAlarm = true;
|
hasAlarm = true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
void Update()
|
void Update()
|
||||||
{
|
{
|
||||||
if(hasAlarm && !AlarmSequence.isPlaying) // If alarm state has ended.
|
if(hasAlarm && !AlarmSequence.isPlaying) // If alarm state has ended.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user