.
This commit is contained in:
parent
1c6282b65a
commit
7e4194be49
@ -25,8 +25,10 @@ public class MonsterController : MonoBehaviour
|
|||||||
{
|
{
|
||||||
playerTr = GameObject.Find("Player").GetComponent<Transform>();
|
playerTr = GameObject.Find("Player").GetComponent<Transform>();
|
||||||
monsterTr = transform;
|
monsterTr = transform;
|
||||||
|
agent = GetComponent<NavMeshAgent>();
|
||||||
|
|
||||||
StartCoroutine(CheckMonsterState());
|
StartCoroutine(CheckMonsterState());
|
||||||
|
StartCoroutine(MonsterAction());
|
||||||
}
|
}
|
||||||
|
|
||||||
IEnumerator CheckMonsterState()
|
IEnumerator CheckMonsterState()
|
||||||
@ -63,6 +65,9 @@ public class MonsterController : MonoBehaviour
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case State.TRACE:
|
case State.TRACE:
|
||||||
|
// 추적 시작
|
||||||
|
agent.SetDestination(playerTr.position);
|
||||||
|
agent.isStopped = false;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case State.ATTACK:
|
case State.ATTACK:
|
||||||
|
Loading…
Reference in New Issue
Block a user