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; } } }
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(); }
// 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; }
void onAlarmStateChanged(AlarmStateChanged alarmStateChanged) { if (CurrentAlarmState != alarmStateChanged.AlarmState) { CurrentAlarmState = alarmStateChanged.AlarmState; } if (CurrentAlarmState == GeneralVariables.ALARMSTATE.FULL) { if (FSM.GetGuardIdle()) { FSM.AlarmStateSwitch(CurrentAlarmState); } } }
// 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; }
void onAlarmStateChanged(AlarmStateChanged alarmStateChanged) { setAnimationNormalColour(alarmStateChanged.StateColour); bellColourAnimation.PlayAnimation(); }
private void OnDestroy() { AlarmStateChanged.RemoveListener(onAlarmStateChanged); ResolutionScreenSetup.OnLoadCheckpoint -= onLoadCheckpoint; }
private void OnDestroy() { AlarmStateChanged.RemoveListener(onAlarmStateChanged); }