fixing fire system
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class Hammer : MonoBehaviour
|
||||
@@ -12,10 +10,14 @@ public class Hammer : MonoBehaviour
|
||||
|
||||
private void OnCollisionEnter2D(Collision2D collision)
|
||||
{
|
||||
var mapElement = collision.collider.GetComponent<MapElement>();
|
||||
var mapElement = collision.collider.GetComponent<MapElement>();
|
||||
if(mapElement!=null)
|
||||
{
|
||||
Destroy(gameObject);
|
||||
}
|
||||
if (mapElement?.ElementSO.ElementType==MapElementType.BreakableWall)
|
||||
{
|
||||
Destroy(collision.gameObject);
|
||||
mapElement.Hit();
|
||||
Destroy(gameObject);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user