Files
butchers-games-test/Assets/Scripts/Game/Player/TurnZoneHandler.cs
T
Boris Nikolaev 5f1e94b653 add project files
2026-08-14 01:58:31 +03:00

21 lines
366 B
C#

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);
}
}
}
}