using UnityEngine;
using System.Collections;

public class PlayerKiller : MonoBehaviour {
    private GameManager gameManager;

    void Start() {
        gameManager = FindObjectOfType<GameManager>();
    }

    public void OnCollisionEnter(Collision collision) {
        if (collision.gameObject.tag == "Player") {
            StartCoroutine(gameManager.decreaseHealth(int.MaxValue));
        }
    }
}
