public bool IsVertex(Int3 p, out int index) { index = -1; if (v0.IsEqualXZ(ref p)) { index = 0; } else if (v1.IsEqualXZ(ref p)) { index = 1; } else if (v2.IsEqualXZ(ref p)) { index = 2; } return(index != -1); }