@@ -1932,8 +1932,7 @@ internal void InitializeData()
19321932 // can manually turn off one of them to optimize operation.
19331933 m_UpdateMask = InputUpdateType . Dynamic | InputUpdateType . Fixed ;
19341934#if ! UNITY_INPUTSYSTEM_SUPPORTS_FOCUS_EVENTS
1935- m_FocusState = FocusFlags . None ; //Application.isFocused ? focusState |= FocusFlags.ApplicationFocus
1936- // : focusState &= ~FocusFlags.ApplicationFocus;
1935+ m_FocusState = FocusFlags . None ;
19371936#endif
19381937
19391938#if UNITY_EDITOR
@@ -2141,7 +2140,7 @@ internal void InstallRuntime(IInputRuntime runtime)
21412140 m_Runtime . pollingFrequency = pollingFrequency ;
21422141
21432142 focusState = Application . isFocused ? focusState |= FocusFlags . ApplicationFocus
2144- : focusState &= ~ FocusFlags . ApplicationFocus ;
2143+ : focusState &= ~ FocusFlags . ApplicationFocus ;
21452144
21462145 // We only hook NativeInputSystem.onBeforeUpdate if necessary.
21472146 if ( m_BeforeUpdateListeners . length > 0 || m_HaveDevicesWithStateCallbackReceivers )
@@ -3044,26 +3043,24 @@ internal bool ShouldRunUpdate(InputUpdateType updateType)
30443043 return ( updateType & mask ) != 0 ;
30453044 }
30463045
3047-
3048-
3049- /// <summary>
3050- /// Process input events.
3051- /// </summary>
3052- /// <param name="updateType"></param>
3053- /// <param name="eventBuffer"></param>
3054- /// <remarks>
3055- /// This method is the core workhorse of the input system. It is called from <see cref="UnityEngineInternal.Input.NativeInputSystem"/>.
3056- /// Usually this happens in response to the player loop running and triggering updates at set points. However,
3057- /// updates can also be manually triggered through <see cref="InputSystem.Update"/>.
3058- ///
3059- /// The method receives the event buffer used internally by the runtime to collect events.
3060- ///
3061- /// Note that update types do *NOT* say what the events we receive are for. The update type only indicates
3062- /// where in the Unity's application loop we got called from. Where the event data goes depends wholly on
3063- /// which buffers we activate in the update and write the event data into.
3064- /// </remarks>
3065- /// <exception cref="InvalidOperationException">Thrown if OnUpdate is called recursively.</exception>
3066- [ System . Diagnostics . CodeAnalysis . SuppressMessage ( "Microsoft.Performance" , "CA1809:AvoidExcessiveLocals" , Justification = "TODO: Refactor later." ) ]
3046+ /// <summary>
3047+ /// Process input events.
3048+ /// </summary>
3049+ /// <param name="updateType"></param>
3050+ /// <param name="eventBuffer"></param>
3051+ /// <remarks>
3052+ /// This method is the core workhorse of the input system. It is called from <see cref="UnityEngineInternal.Input.NativeInputSystem"/>.
3053+ /// Usually this happens in response to the player loop running and triggering updates at set points. However,
3054+ /// updates can also be manually triggered through <see cref="InputSystem.Update"/>.
3055+ ///
3056+ /// The method receives the event buffer used internally by the runtime to collect events.
3057+ ///
3058+ /// Note that update types do *NOT* say what the events we receive are for. The update type only indicates
3059+ /// where in the Unity's application loop we got called from. Where the event data goes depends wholly on
3060+ /// which buffers we activate in the update and write the event data into.
3061+ /// </remarks>
3062+ /// <exception cref="InvalidOperationException">Thrown if OnUpdate is called recursively.</exception>
3063+ [ System . Diagnostics . CodeAnalysis . SuppressMessage ( "Microsoft.Performance" , "CA1809:AvoidExcessiveLocals" , Justification = "TODO: Refactor later." ) ]
30673064 private unsafe void OnUpdate ( InputUpdateType updateType , ref InputEventBuffer eventBuffer )
30683065 {
30693066 using ( k_InputUpdateProfilerMarker . Auto ( ) )
@@ -3128,7 +3125,7 @@ private unsafe void OnUpdate(InputUpdateType updateType, ref InputEventBuffer ev
31283125 var dropStatusEvents = false ;
31293126
31303127#if UNITY_INPUTSYSTEM_SUPPORTS_FOCUS_EVENTS
3131- // we exit early as we have no events in the buffer
3128+ // we exit early as we have no events in the buffer
31323129 if ( eventBuffer . eventCount == 0 )
31333130 {
31343131 // Normally, we process action timeouts after first processing all events. If we have no
@@ -3141,7 +3138,7 @@ private unsafe void OnUpdate(InputUpdateType updateType, ref InputEventBuffer ev
31413138 return ;
31423139 }
31433140#if UNITY_EDITOR
3144- dropStatusEvents = ShouldDropStatusEvents ( eventBuffer ) ;
3141+ dropStatusEvents = ShouldDropStatusEvents ( eventBuffer ) ;
31453142#endif
31463143
31473144#else
@@ -3865,6 +3862,7 @@ private bool ShouldDropStatusEvents(InputEventBuffer eventBuffer)
38653862 // like to drop status events, and do not early out.
38663863 return ( ! gameIsPlaying && gameShouldGetInputRegardlessOfFocus && ( eventBuffer . sizeInBytes > ( 100 * 1024 ) ) ) ;
38673864 }
3865+
38683866#endif // UNITY_INPUTSYSTEM_SUPPORTS_FOCUS_EVENTS
38693867
38703868 [ MethodImpl ( MethodImplOptions . AggressiveInlining ) ]
@@ -3916,7 +3914,6 @@ private bool ShouldExitEarlyBasedOnBackgroundBehavior(FourCC currentEventType, I
39163914 return false ;
39173915 }
39183916
3919-
39203917 /// <summary>
39213918 /// Determines if an event should be discarded based on timing or focus state.
39223919 /// </summary>
0 commit comments