objective interface
This commit is contained in:
23
Assets/Actors/Controllable/FocalPoint/FocalPoint.cs
Normal file
23
Assets/Actors/Controllable/FocalPoint/FocalPoint.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using UnityEngine;
|
||||
|
||||
[System.Serializable]
|
||||
public class FocalPoint : MonoBehaviour
|
||||
{
|
||||
[SerializeField] bool isInGoal = false;
|
||||
|
||||
void OnTriggerEnter(Collider other) {
|
||||
if (other.gameObject.tag == "Goal") {
|
||||
isInGoal = true;
|
||||
}
|
||||
}
|
||||
|
||||
void OnTriggerExit(Collider other) {
|
||||
if (other.gameObject.tag == "Goal") {
|
||||
isInGoal = false;
|
||||
}
|
||||
}
|
||||
|
||||
public bool GetIsInGoal() {
|
||||
return isInGoal;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user