24 lines
442 B
C#
24 lines
442 B
C#
|
|
using UnityEngine;
|
||
|
|
|
||
|
|
public class BaseTrigger : MonoBehaviour
|
||
|
|
{
|
||
|
|
protected Log log;
|
||
|
|
|
||
|
|
protected virtual void Awake()
|
||
|
|
{
|
||
|
|
log = FindFirstObjectByType<Log>();
|
||
|
|
}
|
||
|
|
|
||
|
|
protected virtual void OnTriggerEnter(Collider other)
|
||
|
|
{
|
||
|
|
if (other.CompareTag("Player"))
|
||
|
|
{
|
||
|
|
OnPlayerEnter();
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
// Override this in subclasses
|
||
|
|
protected virtual void OnPlayerEnter()
|
||
|
|
{
|
||
|
|
}
|
||
|
|
}
|