DestroyObjectByEarth.cs 387 Bytes
Newer Older
mthiele2's avatar
mthiele2 committed
1 2 3 4 5 6 7 8 9
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using _Game.Scripts.Player.PlayerAttacks.Earth;

public class DestroyObjectByEarth : MonoBehaviour
{
	void OnCollisionEnter2D(Collision2D other)
	{
10
		if (!other.gameObject.CompareTag("Player")) return;
mthiele2's avatar
mthiele2 committed
11 12 13 14 15 16
		if (other.gameObject.GetComponent<PlayerEarthAttack>().isStomping)
		{
			Destroy(gameObject);
		}
	}
}