add project files
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
public class TurnZoneHandler : MonoBehaviour
|
||||
{
|
||||
public event Action<Section> onTurn;
|
||||
|
||||
private void OnTriggerEnter(Collider other)
|
||||
{
|
||||
TurnZone zone = other.GetComponentInParent<TurnZone>();
|
||||
if (!(zone == null) && !zone.isTurn)
|
||||
{
|
||||
zone.useTurn();
|
||||
if (this.onTurn != null)
|
||||
{
|
||||
this.onTurn(zone.section);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user