private void Die()
 {
     GetComponent <PlayerController>().dead = true;
     Destroy(GetComponent <CapsuleCollider>());
     Destroy(GetComponent <Footsteps>());
     Destroy(GetComponent <PlayerIK>());
     Destroy(GetComponent <Animator>());
     ragdolify.MakeRagdoll();
     StartCoroutine(DeathReset());
 }
Example #2
0
    public void Ending()
    {
        Destroy(musicObject);
        explosion.Play();
        explosionSound.Play();
        endMusic.Play();
        Ragdolify player = FindObjectOfType <Ragdolify>();

        player.GetComponent <PlayerController>().dead = true;
        Destroy(player.GetComponent <CapsuleCollider>());
        Destroy(player.GetComponent <Footsteps>());
        Destroy(player.GetComponent <PlayerIK>());
        Destroy(player.GetComponent <Animator>());
        Destroy(GetComponent <MeshRenderer>());
        healthFill.color = Color.clear;
        player.MakeRagdoll();
        FindObjectOfType <PlayerHealth>().GetComponent <Rigidbody>().AddExplosionForce(1000, transform.position, 50);
        StartCoroutine(SlowFadeToBlack());
    }