public struct Test1 : ISharedComponentData {
public int value;
}
public struct Test2 : ISharedComponentData {
public int value;
}
public void Print() {
Test1 x = new Test1 { value = 1 };
Test2 y = new Test2 { value = 1 };
Debug.Log(TypeManager.GetHashCode(ref x));
Debug.Log(TypeManager.GetHashCode(ref y));
}
It is a bug ?
When world dispose, and dispose entity queries,if entity query has set this SharedComponents filter, It will cause error :
The hash being the same is expected, but the internal state corruption as a result is a bug, which is my own fault. Will fix. (There’s a hash table that uses this hash as a key, and it should actually use this hash + the type index as the key.)
Actually, I thought that was the fix, but now looking at it further I think I was wrong and now I have no idea how you got that exception to throw. @hxhloveunity can you share a bit more about how you did your querying and what the callstack for that exception was?