GenerateGraph.GetPairString C# (CSharp) Метод

GetPairString() публичный Метод

Given two Vector3 objects, creates a string representation of that pair with the smaller Vector3 object coming first (ex: (1,2,3) and (4,5,6) will be respresented as "1,2,3 - 4,5,6" with the smaller Vector3 coming first)
public GetPairString ( Vector3 v1, Vector3 v2 ) : string
v1 Vector3 the first given Vector3
v2 Vector3 the second given Vector3
Результат string
    public string GetPairString(Vector3 v1, Vector3 v2)
    {
        float[] v1Components = new float[3];
        v1Components[0] = v1.x;
        v1Components[1] = v1.y;
        v1Components[2] = v1.z;
        float[] v2Components = new float[3];
        v2Components[0] = v2.x;
        v2Components[1] = v2.y;
        v2Components[2] = v2.z;
        Vector3 first = v1;
        Vector3 second = v2;
        for (int i = 0; i < 3; i++) {
            if (v1Components[i] > v2Components[i]) {
                Vector3 temp = second;
                second = first;
                first = temp;
                break;
            } else if(v1Components[i] < v2Components[i]) {
                break;
            }
        }
        return first.x + "," + first.y + "," + first.z + " - " + second.x + "," +
            second.y + "," + second.z;
    }