Пример #1
0
        private IEnumerator CompleteRoomEffects()
        {
            audio.PlaySound(43);                                             // alarm 1
            audio.ChangeSoundVolume(43, .5f);
            yield return(new WaitForSeconds(audio.GetSoundLength(43) + 3f)); // ~3.8s + 2s = ~5.8s

            audio.PlaySound(44);                                             // alarm 2
            audio.ChangeSoundVolume(44, .5f);
            yield return(new WaitForSeconds(audio.GetSoundLength(44) + 1f)); // + ~3.25s + 1s = ~10s

            audio.PlaySound(45);                                             // explosion
            yield return(new WaitForSeconds(audio.GetSoundLength(45) + 3f)); // + ~8.5s + 3s = ~20.5s (start voice at 3.5s)

            lighting.SwitchAllLights(LightSetting.On);

            // reset room after some time
            yield return(new WaitForSeconds(DelayUntilRoomReset));

            Room.Initialize();
        }