void onAlarmStateChanged(AlarmStateChanged stateChanged)
    {
        if (currentAlarmState != stateChanged.AlarmState)
        {
            switch (stateChanged.AlarmState)
            {
            case GeneralVariables.ALARMSTATE.NONE:
                StartCoroutine(crossFadeTracks(currentAudioSource, audioSources[0]));
                currentAlarmState = stateChanged.AlarmState;
                break;

            case GeneralVariables.ALARMSTATE.LOW:
                StartCoroutine(crossFadeTracks(currentAudioSource, audioSources[1]));
                currentAlarmState = stateChanged.AlarmState;
                break;

            case GeneralVariables.ALARMSTATE.HIGH:
                StartCoroutine(crossFadeTracks(currentAudioSource, audioSources[2]));
                currentAlarmState = stateChanged.AlarmState;
                break;

            case GeneralVariables.ALARMSTATE.FULL:
                StartCoroutine(crossFadeTracks(currentAudioSource, audioSources[3]));
                currentAlarmState = stateChanged.AlarmState;
                break;
            }
        }
    }
Esempio n. 2
0
 private void OnDestroy()
 {
     tracker.OnAlarmLevelIncrease -= onAlarmLevelIncreased;
     tracker.OnAlarmLevelDecrease -= onAlarmLevelDecreased;
     AlarmStateChanged.RemoveListener(onAlarmStateChanged);
     ResolutionScreenSetup.OnLoadCheckpoint -= onLoadCheckpoint;
 }
 // Start is called before the first frame update
 void Start()
 {
     audioSources = GetComponents <AudioSource>();
     AlarmStateChanged.AddListener(onAlarmStateChanged);
     setVolumeAllAudioSources(0);
     currentAudioSource        = audioSources[0];
     currentAudioSource.volume = maxVolume;
 }
 private void OnDestroy()
 {
     AlarmTriggered.ClearListeners();
     CameraTriggered.ClearListeners();
     CollectablePickedupEvent.ClearListeners();
     GameOverEvent.ClearListeners();
     AlarmStateChanged.ClearListeners();
     ShowDialogueEvent.ClearListeners();
 }
Esempio n. 5
0
 // Start is called before the first frame update
 void Start()
 {
     alarmSlider                   = GetComponent <Slider>();
     tracker                       = GameObject.FindObjectOfType <AlarmTracker>();
     blinkAnimation                = GetComponent <ColourBlinkAnimation>();
     spikeAnimation                = GetComponent <ColourSpikeAnimation>();
     bellShake                     = GetComponent <BellShakeAnimation>();
     bellColourAnimation           = GetComponent <ColourEaseAnimation>();
     alarmSlider.value             = 0;
     tracker.OnAlarmLevelIncrease += onAlarmLevelIncreased;
     tracker.OnAlarmLevelDecrease += onAlarmLevelDecreased;
     AlarmStateChanged.AddListener(onAlarmStateChanged);
     ResolutionScreenSetup.OnLoadCheckpoint += onLoadCheckpoint;
 }
Esempio n. 6
0
 void onAlarmStateChanged(AlarmStateChanged alarmStateChanged)
 {
     if (CurrentAlarmState != alarmStateChanged.AlarmState)
     {
         CurrentAlarmState = alarmStateChanged.AlarmState;
     }
     if (CurrentAlarmState == GeneralVariables.ALARMSTATE.FULL)
     {
         if (FSM.GetGuardIdle())
         {
             FSM.AlarmStateSwitch(CurrentAlarmState);
         }
     }
 }
Esempio n. 7
0
        // Start is called before the first frame update
        void Start()
        {
            if (isPatrolling)
            {
                FSM.ChangeState <PatrolState>();
            }
            else
            {
                FSM.ChangeState <IdleState>();
            }

            abstractAlarmManager.AbstractAlarmActivated += onAbstractAlarmActivated;
            AlarmStateChanged.AddListener(onAlarmStateChanged);
            ResolutionScreenSetup.OnLoadCheckpoint += onLoadCheckpoint;
        }
Esempio n. 8
0
 void onAlarmStateChanged(AlarmStateChanged alarmStateChanged)
 {
     setAnimationNormalColour(alarmStateChanged.StateColour);
     bellColourAnimation.PlayAnimation();
 }
Esempio n. 9
0
 private void OnDestroy()
 {
     AlarmStateChanged.RemoveListener(onAlarmStateChanged);
     ResolutionScreenSetup.OnLoadCheckpoint -= onLoadCheckpoint;
 }
 private void OnDestroy()
 {
     AlarmStateChanged.RemoveListener(onAlarmStateChanged);
 }