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

public class Deadly : MonoBehaviour
{
    private GameObject m_immuneObject;

    public GameObject immuneObject
    {
        get { return m_immuneObject; }
        set { m_immuneObject = value; }
    }

    public void OnTriggerEnter2D(Collider2D collider)
    {
        if (collider.transform.tag == "Player" && 
            collider.gameObject != m_immuneObject && 
            collider.transform.GetComponent<Killable>())
        {
			collider.transform.GetComponent<Killable>().Kill(m_immuneObject);
        }
    }

    // Use this for initialization
    void Start()
    {

    }

    // Update is called once per frame
    void Update()
    {

    }
}
