add spawn point, death

This commit is contained in:
2023-07-10 19:21:58 +03:00
parent 9d68af5244
commit 2df859debe
9 changed files with 163 additions and 7 deletions
+1 -6
View File
@@ -11,15 +11,10 @@ public class Hammer : MonoBehaviour
private void OnCollisionEnter2D(Collision2D collision)
{
var mapElement = collision.collider.GetComponent<MapElement>();
if(mapElement!=null)
{
Destroy(gameObject);
}
if (mapElement?.ElementSO.ElementType==MapElementType.BreakableWall)
if (mapElement != null)
{
mapElement.Hit();
Destroy(gameObject);
}
}
}