Esempio n. 1
0
        public void GeneratorTurnedOn(Generator generator)
        {
            if (!completedGenerators.Contains(generator))
            {
                completedGenerators.Add(generator);

                if (completedGenerators.Count >= requiredGeneratorsToComplete)
                {
                    if (onCompleted != null)
                    {
                        onCompleted.Invoke();
                        VOSequencer.ReplaceEvent("02_lobbyBot_dry_VO1_C__generator_v2");
                    }
                }

                int generatorsLeft = requiredGeneratorsToComplete - completedGenerators.Count;

                if (generatorsLeft == 2)
                {
                    VOSequencer.AddEvent("twomore_plugs");
                }
                if (generatorsLeft == 1)
                {
                    VOSequencer.ReplaceEvent("onemore_plug");
                }
            }
            if (noGeneratorsStarted)
            {
                noGeneratorsStarted = false;
                VOSequencer.AddEvent("02_lobbyBot_dry_VO1_B__generator_v2");
            }
        }
Esempio n. 2
0
 public void ObjectiveCompleted(string name)
 {
     if (name.Equals("DoorOpened"))
     {
         VOSequencer.AddEvent("08_BOILERROOM_2ndcrank_1");
     }
     if (name.Equals("CrankObjective"))
     {
         VOSequencer.ReplaceEvent("pulllever");
     }
     if (name.Equals("LeverObjective"))
     {
         VOSequencer.ReplaceEvent("05_lobbyBot_dry_VO1_B__boilerroom_v2");
     }
 }
Esempio n. 3
0
        IEnumerator _FinalSequence() {
            _hasCompletedAllInstrumentRequirements = true;
            VOSequencer.ReplaceEvent("10_TESTROOM_initiatetestseq_1");

            //wait a bit and invoke the "completed-all-requirements" event
            yield return new WaitForSeconds(completeAllInstrumentGroupDelay);
            _isPlayingFinalMusic = true;
            _synchronizedPlaybackStartTime = Time.time;

            //store the volume levels of all audio sources
            Dictionary<GvrAudioSource, float> volumeMap = new Dictionary<GvrAudioSource, float>();
            foreach(var src in GetComponentsInChildren<GvrAudioSource>(true)) {
                volumeMap[src] = src.volume;
                src.volume = 0f;
            }

            if(onCompletedAllInstrumentRequirements != null) {
                onCompletedAllInstrumentRequirements.Invoke();
            }
            VOSequencer.ReplaceEvent("10_TESTROOM_simplebye_1");

            for(int i=0; i<instrumentFinalPlayalongFadeInFrames; ++i) {
                //restore the audio levels of all sources
                foreach(var src in volumeMap) {
                    src.Key.volume = Mathf.Lerp(0, src.Value, (float)(i+1)/(float)instrumentFinalPlayalongFadeInFrames);
                }
                yield return new WaitForEndOfFrame();
            }

            //wait a bit and quit the application
            yield return new WaitForSeconds(killAppAfterCompleteDelay);
            GameManager.instance.IsComplete = true;

            if(onFinaleSequenceComplete != null) {
                onFinaleSequenceComplete.Invoke();
            }
                
        }