예제 #1
0
    /// <summary>
    /// Coordinates player death
    /// </summary>
    void Kill()
    {
        isKilling = true;

        GameObject  songObject = this.transform.Find("SongObject").gameObject;
        AudioSource player     = songObject.GetComponent <AudioSource> ();

        player.Stop();

        if (!flickerCoroutineRunning)
        {
            FirstPersonController.instance.NotifyInteract("I don't think it likes that flashlight...", null);

            StartCoroutine(PleaseGodStopMovingSomethingHasToWork());
            animationController.Kill();
            SoundManager.instance.DeathSounds();

            // Freeze player, turn toward enemy
            FirstPersonController.instance.GetComponent <BoxCollider> ().enabled = false;
            FirstPersonController.instance.dying = true;
            Camera.main.transform.LookAt(transform.position + new Vector3(0, .2f, 0));
            Flashlight.instance.transform.LookAt(transform.position);
            StartCoroutine(FlickerCoroutine());
        }
    }