using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class RagdollCollision : MonoBehaviour {

    private RagDollHandler myRagDollHandler;

    public void OnCollisionEnter2D(Collision2D col)
    {
        if (col.collider.gameObject.layer != LayerMask.NameToLayer("Floor") && col.collider.gameObject.layer != LayerMask.NameToLayer("Player1") && col.collider.gameObject.layer != LayerMask.NameToLayer("Player2"))
        {
            myRagDollHandler.playerIsDead = true;
            myRagDollHandler.SetRigidBodies(true);
        }
    }

    public void SetMyRagdollHandler(RagDollHandler ragDollHandler)
    {
        myRagDollHandler = ragDollHandler;
    }

}
