MiniGames/Assets/Scripts/ChaseOn/ChaseObstacle.cs

21 lines
454 B
C#
Raw Normal View History

2025-07-30 01:38:12 +05:00
using UnityEngine;
public class ChaseObstacle : MonoBehaviour
{
private void OnCollisionEnter(Collision collision)
{
if (collision.gameObject.CompareTag("Player"))
{
FindObjectOfType<ChaseScoreManager>().GameOver();
}
}
private void OnTriggerEnter(Collider other)
{
if (other.CompareTag("Player"))
{
FindObjectOfType<ChaseScoreManager>().GameOver();
}
}
}