Skip to content

Commit b8c4202

Browse files
committed
XOR cast
1 parent f41f529 commit b8c4202

File tree

1 file changed

+8
-1
lines changed
  • com.unity.formats.alembic/Runtime/Scripts/Importer

1 file changed

+8
-1
lines changed

com.unity.formats.alembic/Runtime/Scripts/Importer/AbcAPI.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,14 @@ struct aiContext
325325
#if UNITY_6000_4_OR_NEWER
326326
public static aiContext Create(EntityId uid)
327327
{
328-
return NativeMethods.aiContextCreate((int)EntityId.ToULong(uid));
328+
ulong u = EntityId.ToULong(uid);
329+
unchecked
330+
{
331+
int key = (int)(u ^ (u >> 32));
332+
if (key == 0 && u != 0)
333+
key = (int)(u | 1);
334+
return NativeMethods.aiContextCreate(key);
335+
}
329336
}
330337
#endif
331338

0 commit comments

Comments
 (0)