Edit: was a bug that was fixed with restarting Unity.
I'm trying to pass an enum from a struct into a method and it's yeilding a burst hash error:
Burst internal compiler error: System.Exception: Error while generating hash for method references: System.Exception: Error while hashing 0x06000041
I decided to replace the argument with a constant, and I get this error instead:
System.cs(131,13): Burst error BC0101: ... Value cannot be null.
Here is the code causing issues:
ECB.SetComponent(partEntity, new PhysicsCollider {
Value = SelectCollider(ColliderType.Sphere, partInfo.Scale, float3.zero, partInfo.Rotation )
});
public BlobAssetReference<Collider> SelectCollider(ColliderType ColliderType, float3 Scale, float3 Offset, float3 Orientation)
{
switch (ColliderType)
{
case ColliderType.Sphere: return stuff
case ColliderType.Box: return stuff
case ColliderType.Cylinder: return stuff
}
return stuff
}
(The ECB line of code is the one causing the error according to my second burst error)
In Burst documentation it is shown that I am unable to use enum methods in burst. However, I'm not using any enum methods. Even if a switch case with enums counts as a method, how come that's not where the error is coming from (as far as I can tell).
What am I missing?