ReplayPuzzleGame/Assets/Resources/Scripts/Prop/WaterEnter.cs

19 lines
517 B
C#
Raw Normal View History

2026-02-08 13:13:32 +00:00
using UnityEngine;
public class WaterEnter : MonoBehaviour
{
private void OnTriggerEnter2D(Collider2D other)
{
Debug.Log(other.gameObject.name);
if (other.tag == "Player")
{
2026-02-10 08:18:34 +00:00
GameManager.instance.PlayerDie();
2026-02-08 13:13:32 +00:00
} else if (other.tag == "Ghost")
{
other.GetComponent<PlayerMovement>().enabled = false;
other.GetComponent<GhostController>().enabled = false;
other.GetComponent<Animator>().SetTrigger("Die");
}
}
}