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