Exemple #1
0
        // Start is called before the first frame update
        void Start()
        {
            nightmareController       = GameObject.Find("NightmareController").GetComponent <NightmareController>();
            fPSController             = GameObject.Find("Player").GetComponent <FPSController>();
            flashlight                = GameObject.Find("Player/MainCamera/Flashlight").GetComponent <FlashlightController>();
            spectreVisionController   = GameObject.Find("Player/ClueCamera/SpectrePopup").GetComponent <SpectreVisionController>();
            backgroundMusicController = GameObject.Find("Player/BGMusic").GetComponent <BackgroundMusicController>();
            clueCameraTracker         = GameObject.Find("Player/ClueCamera").GetComponent <CameraTracker>();
            audioSource               = GetComponent <AudioSource>();
            playSeriesOfAudioClips    = GetComponent <PlaySeriesOfAudioClips>();
            //if (spawnsEnemy)
            //    enemy.SetActive(false);

            nightmareTriggerDelay = 0.0f;
            for (int i = 0; i < audioClipsBeforeTrigger; i++)
            {
                nightmareTriggerDelay += playSeriesOfAudioClips.GetClipLength(i);
            }
            if (nightmareTriggerDelay != 0)
            {
                Debug.Log("Nightmare triggers with " + nightmareTriggerDelay + " s delay.");
            }

            //Disable final scene trigger at startup
            if (enablesClue)
            {
                StartCoroutine(DisableNextClue());
            }


            //Debug.Log("Started up " + gameObject.name);
        }
Exemple #2
0
        // Start is called before the first frame update
        void Start()
        {
            audioSource   = GetComponent <AudioSource>();
            fPSController = GameObject.Find("Player").GetComponent <FPSController>();
            exitCollider  = GetComponent <BoxCollider>();
            childRender   = GetComponentInChildren <Renderer>();
            GameObject.Find("[UI]/Canvas4/GameCredits").SetActive(false);
            backgroundMusicController = GameObject.Find("Player/BGMusic").GetComponent <BackgroundMusicController>();

            childRender.enabled  = false;
            exitCollider.enabled = false;
        }