Ejemplo 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");
            }
        }
Ejemplo n.º 2
0
        IEnumerator _Delayed_Complete()
        {
            var frame = new WaitForEndOfFrame();

            //for some reason, changing focus on the app will cause audio.isPlaying to return false, even if it's still playing. I'm fudging a grace-period of 5 frames to compensate
            bool donePlaying = false;

            while (!donePlaying)
            {
                while (screenAudio.isPlaying)
                {
                    yield return(frame);
                }

                donePlaying = true;
                for (int i = 0; i < 5; ++i)
                {
                    if (screenAudio.isPlaying)
                    {
                        donePlaying = false;
                        break;
                    }
                    yield return(frame);
                }
            }

            screenAnimator.SetBool(ANIM_PROP_PLAYING, false);

            VOSequencer.AddEvent("01_LOBBY_controlalt_1");
            _completed = true;
        }
Ejemplo n.º 3
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");
     }
 }
Ejemplo n.º 4
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();
            }
                
        }
Ejemplo n.º 5
0
 protected override void InRoom() {
     base.InRoom();
     VOSequencer.AddEvent("10_TESTROOM_intro_1");
 }
Ejemplo n.º 6
0
 protected override void InRoom()
 {
     base.InRoom();
     VOSequencer.AddEvent("02_lobbyBot_dry_VO1_A_generator_v2");
 }
Ejemplo n.º 7
0
 protected override void InRoom()
 {
     base.InRoom();
     VOSequencer.AddEvent("08_BOILERROOM_intro_1");
 }
Ejemplo n.º 8
0
 protected override void InRoom()
 {
     base.InRoom();
     VOSequencer.AddEvent("welcomegreenhouse_2");
     VOSequencer.AddEvent("turnhandle");
 }