private void OnCollisionEnter2D(Collision2D other)
{
if (other.gameObject.CompareTag("Player"))
{
Vector2 direction = other.GetContact(0).normal;
if (direction.y == -1 || direction.y == 1)
{
player.EnemyKill();
//GetComponent<Collider2D>().enabled = false;
Score.Instance.AddHundoPeice();
Destroy(this.gameObject, 0.1f);
}
else
{
other.gameObject.transform.position = sp.lastCheckPointPos;
checkpoint.dead = true;
if(other.gameObject.CompareTag("Player"))
Lives.Instance.MinusLife();
}
}
}