using UnityEngine;

public class EnemyStateIdle: IEnemyState
{

    private EnemyController _enemyController;

    public void Enter(EnemyController enemyController)
    {
        _enemyController = enemyController;
        Debug.Log("## Idle 상태 진입");
        _enemyController.SetAnimation(EnemyController.Idle, true);
    }

    public void Update()
    {
        var detectPlayerTransform = _enemyController.DetectPlayerInCircle();
        if (detectPlayerTransform)
        {
            _enemyController.SetState(EnemyState.Trace);
        }
    }

    public void Exit()
    {
        _enemyController.SetAnimation(EnemyController.Idle, false);
        _enemyController = null;
    }
}