32 lines
710 B
C#
32 lines
710 B
C#
using System;
|
|
using Code.Gameplay.Orders.Order;
|
|
using Reflex.Attributes;
|
|
using UnityEngine;
|
|
|
|
namespace Code.Generator
|
|
{
|
|
public class RoomTrigger : MonoBehaviour
|
|
{
|
|
[Inject] private IOrderService _orderService;
|
|
|
|
public static event Action PlayerEnteredRoom;
|
|
|
|
private bool _playerEntered;
|
|
|
|
// [Inject]
|
|
// private void Construct(IOrderService orderService)
|
|
// {
|
|
// _orderService = orderService;
|
|
// }
|
|
private void OnTriggerEnter(Collider other)
|
|
{
|
|
if (_playerEntered) return;
|
|
|
|
_playerEntered = true;
|
|
|
|
_orderService.RoomPassed();
|
|
|
|
PlayerEnteredRoom?.Invoke();
|
|
}
|
|
}
|
|
} |