Working on entrance and building out first level
This commit is contained in:
24
Assets/Scripts/Triggers/Trigger.cs
Normal file
24
Assets/Scripts/Triggers/Trigger.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
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()
|
||||
{
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user