Working on entrance and building out first level
This commit is contained in:
9
Assets/Scripts/Triggers/EntranceTrigger.cs
Normal file
9
Assets/Scripts/Triggers/EntranceTrigger.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class WelcomeTrigger : BaseTrigger
|
||||
{
|
||||
protected override void OnPlayerEnter()
|
||||
{
|
||||
log.WriteOutLog("Welcome to my spaceship engineer, we are currently undergoing some maintance so please allow my robots some leeway", 0.05f);
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/Triggers/EntranceTrigger.cs.meta
Normal file
2
Assets/Scripts/Triggers/EntranceTrigger.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 298f124a3fdf91f41b692cf145cb29cd
|
||||
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()
|
||||
{
|
||||
}
|
||||
}
|
||||
2
Assets/Scripts/Triggers/Trigger.cs.meta
Normal file
2
Assets/Scripts/Triggers/Trigger.cs.meta
Normal file
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5060b3e8fb6da8f41a3da4eaa47ba624
|
||||
Reference in New Issue
Block a user