diff --git a/Packages/com.unity.inputsystem/InputSystem/Events/InputEvent.cs b/Packages/com.unity.inputsystem/InputSystem/Events/InputEvent.cs index 7dfe7f045d..09787c9eeb 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Events/InputEvent.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Events/InputEvent.cs @@ -65,7 +65,20 @@ public struct InputEvent /// public const int InvalidEventId = 0; + #if UNITY_INPUT_SYSTEM_INPUT_MODULE_DEFINES_EVENT_PACKING_ALIGNMENT + /// + /// Defines the packing alignment of native input events in event buffers. + /// + /// + /// This is dictated by the native module implementation which populates the event buffers. + /// + internal const int kAlignment = NativeInputEvent.alignment; + #else + /// + /// Defines the packing alignment of native input events in event buffers. + /// internal const int kAlignment = 4; + #endif [FieldOffset(0)] private NativeInputEvent m_Event; diff --git a/Packages/com.unity.inputsystem/InputSystem/Unity.InputSystem.asmdef b/Packages/com.unity.inputsystem/InputSystem/Unity.InputSystem.asmdef index cbf773a654..0c1ec3af68 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Unity.InputSystem.asmdef +++ b/Packages/com.unity.inputsystem/InputSystem/Unity.InputSystem.asmdef @@ -111,6 +111,11 @@ "name": "com.unity.modules.unityanalytics", "expression": "1", "define": "UNITY_INPUT_SYSTEM_ENABLE_ANALYTICS" + }, + { + "name": "Unity", + "expression": "6000.3.0", + "define": "UNITY_INPUT_SYSTEM_INPUT_MODULE_DEFINES_EVENT_PACKING_ALIGNMENT" } ], "noEngineReferences": false