Skip to content

Commit df8c990

Browse files
formatting
1 parent 45a64eb commit df8c990

3 files changed

Lines changed: 26 additions & 28 deletions

File tree

Assets/Tests/InputSystem/Plugins/UITests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4515,7 +4515,7 @@ public IEnumerator UI_DisplayIndexMatchesDisplayMultiplePointers()
45154515
}
45164516

45174517
#endif
4518-
#endregion
4518+
#endregion
45194519

45204520
public class MyButton : UnityEngine.UI.Button
45214521
{

Packages/com.unity.inputsystem/InputSystem/InputManager.cs

Lines changed: 23 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -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>

Packages/com.unity.inputsystem/InputSystem/NativeInputRuntime.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ public FocusFlags focusState
214214
{
215215
get => m_FocusState;
216216
set => m_FocusState = value;
217-
}
217+
}
218218
public bool isPlayerFocused => (m_FocusState & FocusFlags.ApplicationFocus) != 0;
219219

220220
public float pollingFrequency
@@ -297,6 +297,7 @@ private void OnFocusChanged(bool focus)
297297
{
298298
m_FocusChangedMethod(focus);
299299
}
300+
300301
#endif
301302

302303
public Vector2 screenSize => new Vector2(Screen.width, Screen.height);

0 commit comments

Comments
 (0)