void OnTriggerStay(Collider collider)
 {
     if (collider.tag == "Player" && !flashLight.HasPickedUp())
     {
         isColliding        = true;
         playerMessage.text = "F - Take Flashlight";
     }
     else if (flashLight.HasPickedUp())
     {
         playerMessage.text = "";
     }
 }
Esempio n. 2
0
    void Update()
    {
        if (isColliding && !hasPlayedDarkVoice && !flashlight.HasPickedUp())
        {
            hasPlayedDarkVoice = true;
            playerMessage.text = "It's way too dark, I must find some source of light first!";
            Invoke("ClearMessage", 3f);
        }

        if (isColliding && !hasPlayedBlockedVoice && flashlight.HasPickedUp())
        {
            hasPlayedBlockedVoice = true;
            playerMessage.text    = "Anna's voice is coming from the other way!";
            Invoke("ClearMessage", 3f);
        }
    }
Esempio n. 3
0
    void OnTriggerEnter(Collider collider)
    {
        if (collider.tag == "Player" && screamPlayer.GetComponent <AudioSource>().isPlaying)
        {
            screamPlayer.StopScreams();
            GameObject.FindGameObjectWithTag("MainCamera").GetComponent <AudioSource>().Play();

            if (!hasCollided)
            {
                hasCollided = true;
                flashlightObject.SetActive(false);
            }

            if (flashlight.HasPickedUp())
            {
                Destroy(blockingStretcher);
                chainsaw.PlayChainsawAudioAfter(5f);
            }
        }
    }