19 lines
430 B
C#
19 lines
430 B
C#
using UnityEngine;
|
|
|
|
public class BlockDrop_CarrotTrap : MonoBehaviour
|
|
{
|
|
public float lifeTime = 15f;
|
|
void Start()
|
|
{
|
|
Destroy(gameObject, lifeTime);
|
|
}
|
|
|
|
void OnTriggerEnter(Collider other)
|
|
{
|
|
if (other.CompareTag("Player") || other.GetComponent<BlockDrop_WolfController3D>() != null)
|
|
{
|
|
BlockDrop_GameManager3D.Instance.GameOver("Wolf hit a carrot trap!");
|
|
}
|
|
}
|
|
}
|