SamWorkset #1
@ -23,10 +23,13 @@ public class AlarmTrigger : MonoBehaviour
 | 
			
		||||
    void OnButtonPressed()
 | 
			
		||||
    {
 | 
			
		||||
        Debug.Log("Alarm button Pressed!");
 | 
			
		||||
        
 | 
			
		||||
        if (!AlarmSequence.isPlaying) { //if alarm isn't already triggered.
 | 
			
		||||
            VentilationSequence.Stop();
 | 
			
		||||
            AlarmSequence.Play();
 | 
			
		||||
            hasAlarm = true;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    void Update()
 | 
			
		||||
    {
 | 
			
		||||
        if(hasAlarm && !AlarmSequence.isPlaying) // If alarm state has ended.
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user