コード例 #1
0
    void Update()
    {
        Vector3   command;
        Transform neighbor = _nearestNeighbor.GetNearestNeighbor();

        if (neighbor)
        {
            Debug.DrawLine(transform.position, neighbor.position, Color.green);
            command = (neighbor.position - transform.position).normalized;
        }
        else
        {
            command = Random.onUnitSphere;
        }
        _pawn.Move(command);
    }