备份CatanBuilding瘦身独立工程
This commit is contained in:
17
Assets/Scripts/InfiniteBuilding/BlockDeathNotifier.cs
Normal file
17
Assets/Scripts/InfiniteBuilding/BlockDeathNotifier.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
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));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user