using UnityEngine; public class WaterEnter : MonoBehaviour { private void OnTriggerEnter2D(Collider2D other) { Debug.Log(other.gameObject.name); if (other.tag == "Player") { GameManager.instance.EndGame(); } else if (other.tag == "Ghost") { other.GetComponent().enabled = false; other.GetComponent().enabled = false; other.GetComponent().SetTrigger("Die"); } } }