Пример #1
0
    //돌진 시퀀스
    IEnumerator DashSequence()
    {
        //도망치지 마라는 텍스트를 출력하고
        shortText.ShowText("도망치지 마라!", 1f);
        //여기서 플레이어의 방향을 확인하고 돌진
        Vector2 dir = new Vector2(GameManager.Player.position.x - transform.position.x, 0);

        yield return(new WaitForSeconds(1.2f));

        move.SetForce(dir.normalized * 20);

        yield return(new WaitForSeconds(2f));

        // 내가 벽에 때려박아서 스턴이 걸렸거나, 또는 플레이어를 박아서 데미지를 줬거나
        if (ai.currentState != EnemyAI.State.Stun)
        {
            ai.currentState = EnemyAI.State.Chase; //스턴걸리지 않았다면 추적상태로 변경
        }
        lastDashAttackTime = Time.time;
        isPattern          = false;
    }