|
@ -0,0 +1,37 @@ |
|
|
|
|
|
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; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |