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

public class Hazard : MonoBehaviour {

    public PlayerEnum Kills;
    public bool armed = true;

    private void OnTriggerEnter2D(Collider2D other)
    {
        print("Hit");
        switch (Kills)
        {
            case PlayerEnum.Human:
                if (other.gameObject == LevelController.Instance.PlayerHuman) LevelController.Instance.PlayerHuman.SendMessage("Kill");
                break;
            case PlayerEnum.Ghost:
                if (other.gameObject == LevelController.Instance.PlayerGhost) LevelController.Instance.PlayerGhost.SendMessage("Kill");
                break;
            case PlayerEnum.Both:
                if (other.gameObject == LevelController.Instance.PlayerHuman) LevelController.Instance.PlayerHuman.SendMessage("Kill");
                if (other.gameObject == LevelController.Instance.PlayerGhost) LevelController.Instance.PlayerGhost.SendMessage("Kill");
                break;
        }
    }
}
