21 lines
454 B
C#
21 lines
454 B
C#
![]() |
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();
|
||
|
}
|
||
|
}
|
||
|
}
|