for some reason I seem to be getting different results with these two different code snippets. In both cases I’m searching a list of Vector3’s for a particular Vector3 VALUE.
In all the code below tempVertexList is defined as :
List<Vector3> tempVertexList;
This version uses List.Contains() (Which I though might be faster than “by hand”)
//this version seem to fail to find matches
if(tempVertexList.Contains(meshVertices*))*
found=true;
And, this version is “by hand”, which seems to find more matches:
//this version seem to find all matches properly
foreach (Vector3 listVector in tempVertexList)
{
if (listVector == meshVertices*)*
{ found = true; break; }
}
Why do these give different results? Does “Contains” use a different comparison operator? How can I fix that?