using Unity.Collections.LowLevel.Unsafe; namespace GameCore.LowLevel { public static class LowLevelUtility { public static int HashCombine(int h1, int h2) { var hash = h1; hash = (hash * 397) ^ h2; return hash; } public static int HashCombine(int h1, int h2, int h3) { return HashCombine(HashCombine(h1, h2), h3); } public static int OffsetOf() { var fields = typeof(T).GetFields(); foreach (var f in fields) { if (f.DeclaringType == typeof(F)) return UnsafeUtility.GetFieldOffset(f); } return -1; } } }