IEnumerator PlayChase()
        {
            chaseHasHappened = true;

            viewAnimator.SetTrigger("Play");
            dad.GetComponent <PlaySeriesOfAudioClips>().PlaySeries();
            dad.GetComponent <NavMeshAgent>().enabled = false;
            yield return(new WaitForSeconds(5.0f));

            dad.GetComponent <NavMeshAgent>().enabled = true;
            fPSController.ResetMouseView();
            Camera.main.transform.position = originalCameraLocation;
            fPSController.InputControl(true);

            // Add enemy with chase and direction
            ghost.SetActive(true);
            guestBedroomInfoUI.SetActive(true);

            nextScene.SetActive(true);
        }
Пример #2
0
        void PutDownClue()
        {
            transform.rotation   = originalRotation;
            transform.position   = originalPosition;
            transform.localScale = originalScale;

            // Enable player
            fPSController.ResetMouseView();
            fPSController.InputControl(true);
            //enable scene time
            Time.timeScale = 1;
            isViewingClue  = false;

            clueCameraTracker.EnableCamera(false);

            if (causesSpectreVision)
            {
                spectreVisionController.DisplaySpectreForTime(1.0f);
            }

            playSeriesOfAudioClips.Unpause();
        }
Пример #3
0
        IEnumerator Level1IntroScript()
        {
            // Disable display and control and start intro audio
            fPSController.InputControl(false);
            fPSController.CameraTarget(animatedTarget);
            GameObject.Find("[UI]/Canvas2/BlackoutPanel").GetComponent <Image>().color = new Color(0, 0, 0, 255);
            //Wait a tiny bit to let things get out of start
            yield return(new WaitForSeconds(0.1f));

            // Disable first clue
            //firstClue.SetActive(false);

            // Line 7-19
            playSeriesOfAudioClips.PlaySeries();

            float clipLength = playSeriesOfAudioClips.GetClipLength(0);

            Debug.Log(Time.time + " waiting for " + clipLength * percentAudioBeforemovement);
            yield return(new WaitForSeconds(clipLength * percentAudioBeforemovement));

            postProcessingObject.GetComponent <constantDOFChanger>().SetDOF(true, 0);
            StartCoroutine(SlowClearBlackout(clipLength * (1 - percentAudioBeforemovement) / 2));
            viewAnimator.SetTrigger("PlayView");


            Debug.Log(Time.time + " waiting for " + clipLength * (1 - percentAudioBeforemovement));
            yield return(new WaitForSeconds(clipLength * (1 - percentAudioBeforemovement)));

            postProcessingObject.GetComponent <constantDOFChanger>().SetDOF(false, 0);

            // Disable input until 2nd clip is done
            // Line 8
            clipLength = playSeriesOfAudioClips.GetClipLength(1);
            yield return(new WaitForSeconds(clipLength));

            // Re-enable display and control
            fPSController.ResetMouseView();
            fPSController.InputControl(true);

            // Line 9
            clipLength = playSeriesOfAudioClips.GetClipLength(2);
            yield return(new WaitForSeconds(clipLength));

            var flickerNightmareTimeOffset = 0.5f;

            // Line 10
            clipLength = playSeriesOfAudioClips.GetClipLength(3) - flickerNightmareTimeOffset;
            yield return(new WaitForSeconds(clipLength));

            // Line 11-13 (time to flicker lights)
            clipLength = playSeriesOfAudioClips.GetClipLength(4) + playSeriesOfAudioClips.GetClipLength(5) + playSeriesOfAudioClips.GetClipLength(6);

            //Full Nightmare here
            nightmareController.SwitchToNightmare(clipLength);

            // Line 14-16
            clipLength += playSeriesOfAudioClips.GetClipLength(7) + playSeriesOfAudioClips.GetClipLength(8) + playSeriesOfAudioClips.GetClipLength(9);
            yield return(new WaitForSeconds(clipLength));

            //Normal again here
            nightmareController.SwitchToDream();

            // Line 17-20
            clipLength = playSeriesOfAudioClips.GetClipLength(10) + playSeriesOfAudioClips.GetClipLength(11) + playSeriesOfAudioClips.GetClipLength(12) + +playSeriesOfAudioClips.GetClipLength(13) + flickerNightmareTimeOffset;
            yield return(new WaitForSeconds(clipLength));

            firstClue.GetComponent <ClueController>().enableClue();
        }