31 lines
730 B
C#
31 lines
730 B
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
namespace TON
|
|
{
|
|
public class Attack : MonoBehaviour
|
|
{
|
|
[SerializeField]
|
|
private MonsterBase _monsterBase;
|
|
|
|
private void OnTriggerEnter2D(Collider2D other)
|
|
{
|
|
if (other.CompareTag("Player"))
|
|
{
|
|
_monsterBase.IsAttacking = true;
|
|
}
|
|
}
|
|
|
|
private void OnTriggerExit2D(Collider2D other)
|
|
{
|
|
if (other.CompareTag("Player"))
|
|
{
|
|
_monsterBase.IsAttacking = false;
|
|
_monsterBase.IsFisnishAttack = true; // 공격 종료 상태로 설정
|
|
}
|
|
}
|
|
}
|
|
}
|