I have this problem that I posted on the Unity ECS forums. https://discussions.unity.com/t/trying-to-upgrade-to-6-2-typeindex-of-a-generic-buffer-element-is-different/1678487
I have narrowed it down to this test:
[Test]
public void DynamicBufferHashMapTypeTest() {
// Fails
TypeIndexEqualityTest<DynamicBufferHashMap<ConditionId, bool>.Entry<bool>>();
}
[Test]
public void SampleTypeTest() {
// Succeeds
TypeIndexEqualityTest<GenericStruct<ConditionId, bool>.InnerElement<bool>>();
}
private static void TypeIndexEqualityTest<T>() {
Type type = typeof(T);
TypeIndex usingType = TypeManager.GetTypeIndex(type);
TypeIndex usingGeneric = TypeManager.GetTypeIndex<T>();
Assert.AreEqual(usingType.Index, usingGeneric.Index);
}
// Just a sample
public struct GenericStruct<T, U> : IComponentData
where T : unmanaged, IEquatable<T>
where U : unmanaged, IEquatable<U> {
public T t;
public U u;
public struct InnerElement<T> : IBufferElementData where T : unmanaged, IEquatable<T> {
public T t;
}
}
}
This used to work in Unity 6.1. Not sure if this should be a bug.