I'm using a Vector3
- contains properties X
,Y
,Z
as a key in a dictionary. Lets say I already added to the dictionary (myDic
) a Vector3
with values (0,0,0).
Then I do this:
Vector3 vec = new Vector3(0,0,0);
if (!myDic.ContainsKey(vec))
{
//Should never reach here.
}
I also created overload operators for ==
and !=
for the Vector3
class.
It reaches there anyways. Is there a problem when using an object like a Vector3 to be the key for a dictionary?