protected override Coroutine Think()
    {
        //行動予約がある
        if (reserveStates.Count > 0)
        {
            EnemyState next = reserveStates[0];
            reserveStates.RemoveAt(0);
            return(StartAction(next));
        }
        else
        {
            switch (currentState)
            {
            case EnemyState.Idle:
                return(StartAction(EnemyState.MoveNear));

            case EnemyState.Attack:
                idle.waitSecond = 0.5f;
                NewReserve(EnemyState.MoveNear);
                return(StartAction(EnemyState.Idle));

            case EnemyState.Damage:
                idle.waitSecond = 0.5f;
                NewReserve(EnemyState.MoveNear);
                return(StartAction(EnemyState.Idle));

            case EnemyState.MoveNear:

                //近づいていたら攻撃
                if (chasePlayer.isNearPlayer)
                {
                    //優先順位は切り上げ、コンボ
                    if (kiriage.CanAttack())
                    {
                        return(StartAttackAction(kiriage));
                    }
                    else
                    {
                        return(StartAttackAction(combo));
                    }
                }
                //近づいていなければ待機後にもとの場所に戻る
                else
                {
                    NewReserve(EnemyState.MoveDefaultPosition);
                    return(StartAction(EnemyState.Idle));
                }

            case EnemyState.Death:
                return(StartAction(EnemyState.Death));

            default:
                break;
            }
        }

        Debug.LogError("未設定の状態遷移が実行されようとしました。" + currentState);
        return(null);
    }
    protected override Coroutine Think()
    {
        //行動予約がある
        if (reserveStates.Count > 0)
        {
            EnemyState next = reserveStates[0];
            reserveStates.RemoveAt(0);

            if (next == EnemyState.Attack)
            {
                return(StartAttackAction(thunder));
            }

            return(StartAction(next));
        }
        else
        {
            switch (currentState)
            {
            case EnemyState.Idle:
                return(StartAction(EnemyState.MoveNear));

            case EnemyState.Attack:
                idle.waitSecond = 0.5f;
                NewReserve(EnemyState.MoveNear);
                return(StartAction(EnemyState.Idle));

            case EnemyState.Damage:
                idle.waitSecond = 0.5f;
                NewReserve(EnemyState.MoveNear);
                return(StartAction(EnemyState.Idle));

            case EnemyState.MoveNear:

                ////優先順位に応じて攻撃
                if (combo.CanAttack())
                {
                    return(StartAttackAction(combo));
                }
                else
                {
                    return(StartAttackAction(nagiharai));
                }

            case EnemyState.Death:
                return(StartAction(EnemyState.Death));

            default:
                break;
            }
        }

        Debug.LogError("未設定の状態遷移が実行されようとしました。" + currentState);
        return(null);
    }
    protected override Coroutine Think()
    {
        //行動予約がある
        if (reserveStates.Count > 0)
        {
            EnemyState next = reserveStates[0];
            reserveStates.RemoveAt(0);
            return(StartAction(next));
        }
        else
        {
            switch (currentState)
            {
            case EnemyState.Idle:
                return(StartAction(EnemyState.MoveNear));

            case EnemyState.Attack:
                idle.waitSecond = 0.5f;
                NewReserve(EnemyState.MoveNear);
                return(StartAction(EnemyState.Idle));

            case EnemyState.Damage:
                idle.waitSecond = 0.5f;
                NewReserve(EnemyState.MoveNear);
                return(StartAction(EnemyState.Idle));

            case EnemyState.MoveNear:
                if (chasePlayer.isNearPlayer)
                {
                    if (attack.CanAttack())
                    {
                        return(StartAttackAction(attack));
                    }
                    else
                    {
                        return(StartAttackAction(attack2));
                    }
                }

                break;

            case EnemyState.Death:
                return(StartAction(EnemyState.Death));

            default:
                break;
            }
        }

        Debug.LogError("未設定の状態遷移が実行されようとしました。" + currentState);
        return(null);
    }
    protected override Coroutine Think()
    {
        //行動予約がある
        if (reserveStates.Count > 0)
        {
            EnemyState next = reserveStates[0];
            reserveStates.RemoveAt(0);
            return(StartAction(next));
        }
        else
        {
            switch (currentState)
            {
            case EnemyState.Idle:
                return(StartAction(EnemyState.Search));

            case EnemyState.Search:
                if (search.canSearch)
                {
                    return(StartAction(EnemyState.MoveNear));
                }
                else
                {
                    NewReserve(EnemyState.MoveDefaultPosition);
                    return(StartAction(EnemyState.Idle));
                }

            case EnemyState.Attack:
                idle.waitSecond = 0.5f;
                NewReserve(EnemyState.MoveNear);
                return(StartAction(EnemyState.Idle));

            case EnemyState.Damage:
                idle.waitSecond = 0.5f;
                NewReserve(EnemyState.MoveNear);
                return(StartAction(EnemyState.Idle));

            case EnemyState.MoveNear:

                //近づいていたら攻撃
                if (chasePlayer.isNearPlayer)
                {
                    if (priorityAttack.CanAttack())
                    {
                        return(StartAttackAction(priorityAttack));
                    }
                    else
                    {
                        return(StartAttackAction(secondaryAttack));
                    }
                }
                //近づいていなければ待機後にもとの場所に戻る
                else
                {
                    NewReserve(EnemyState.MoveDefaultPosition);
                    return(StartAction(EnemyState.Idle));
                }

            case EnemyState.Death:
                return(StartAction(EnemyState.Death));

            case EnemyState.MoveDefaultPosition:

                //元の場所に戻る途中にプレイヤーを見つけたら追いかける
                if (returnDefaultPositioin.detectPlayer)
                {
                    return(StartAction(EnemyState.MoveNear));
                }

                return(StartAction(EnemyState.Idle));

            default:
                break;
            }
        }

        Debug.LogError("未設定の状態遷移が実行されようとしました。" + currentState);
        return(null);
    }