Files
back_cantanBuilding/Assets/Scripts/InfiniteBuilding/BlockDeathNotifier.cs
2026-05-26 16:15:54 +08:00

18 lines
433 B
C#

using asap.core;
using UnityEngine;
public class BlockDeathNotifier : MonoBehaviour
{
private EventAggregator _eventAggregator;
public void Init(EventAggregator e)
{
_eventAggregator = e;
}
private void OnTriggerEnter2D(Collider2D collision)
{
if (collision.gameObject.TryGetComponent(out Block b))
_eventAggregator.Publish(new EventInfiniteBuildingBlockDeath(b.State));
}
}