16 lines
427 B
C#
16 lines
427 B
C#
using System;
|
|
using Grid;
|
|
using UnityEngine;
|
|
|
|
public class DestructableCrate : MonoBehaviour {
|
|
public GridPosition GridPosition { get; private set; }
|
|
|
|
private void Start() => GridPosition = LevelGrid.Instance.GetGridPosition(transform.position);
|
|
|
|
public static event EventHandler OnAnyDestroyed;
|
|
|
|
public void Damage() {
|
|
Destroy(gameObject);
|
|
OnAnyDestroyed?.Invoke(this, EventArgs.Empty);
|
|
}
|
|
} |