Global Game Jam 2022
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

37 lines
766 B

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Variables;
public class MonsterHitbox : MonoBehaviour, IResettable
{
[SerializeField]
Variable<bool> m_onPlayerDeath;
public void OnLevelLoad()
{
}
public void OnResetEnd()
{
gameObject.layer = LayerMask.NameToLayer("Default");
}
public IEnumerator OnResetStart(float time)
{
yield break;
}
private void OnTriggerEnter2D(Collider2D collision)
{
Debug.Log($"Collision with {collision.gameObject.name}");
if (collision.CompareTag("Player"))
{
gameObject.layer = LayerMask.NameToLayer("Always Visible");
m_onPlayerDeath.Value = true;
}
}
}