|
1 | 1 | using System; |
2 | 2 | using System.Collections.Generic; |
3 | 3 | using System.Diagnostics.CodeAnalysis; |
| 4 | +using System.Runtime.CompilerServices; |
4 | 5 | using UnityEngine.InputSystem.Haptics; |
5 | 6 | using Unity.Collections.LowLevel.Unsafe; |
6 | 7 | using UnityEngine.InputSystem.Controls; |
@@ -74,10 +75,12 @@ namespace UnityEngine.InputSystem |
74 | 75 | /// be called on the main thread. However, select APIs like <see cref="QueueEvent"/> can be |
75 | 76 | /// called from threads. Where this is the case, it is stated in the documentation. |
76 | 77 | /// </remarks> |
| 78 | + |
77 | 79 | [SuppressMessage("Microsoft.Naming", "CA1724:TypeNamesShouldNotMatchNamespaces", Justification = "Options for namespaces are limited due to the legacy input class. Agreed on this as the least bad solution.")] |
78 | 80 | #if UNITY_EDITOR |
79 | 81 | [InitializeOnLoad] |
80 | 82 | #endif |
| 83 | + |
81 | 84 | public static partial class InputSystem |
82 | 85 | { |
83 | 86 | #region Layouts |
@@ -3279,6 +3282,20 @@ public static int ListEnabledActions(List<InputAction> actions) |
3279 | 3282 | /// <value>Current version of the input system.</value> |
3280 | 3283 | public static Version version => new Version(kAssemblyVersion); |
3281 | 3284 |
|
| 3285 | + /// <summary> |
| 3286 | + /// Property for internal use that allows setting the player to run in the background. |
| 3287 | + /// </summary> |
| 3288 | + /// <remarks> |
| 3289 | + /// Some platforms don't care about <see cref="Application.runInBackground"/> and for those we need to |
| 3290 | + /// enable it manually through this propriety. |
| 3291 | + /// </remarks> |
| 3292 | + /// <param name="value">The boolean value to set to <see cref="NativeInputRuntime.runInBackground"/></param> |
| 3293 | + public static bool runInBackground |
| 3294 | + { |
| 3295 | + get => s_Manager.m_Runtime.runInBackground; |
| 3296 | + set => s_Manager.m_Runtime.runInBackground = value; |
| 3297 | + } |
| 3298 | + |
3282 | 3299 | ////REVIEW: restrict metrics to editor and development builds? |
3283 | 3300 | /// <summary> |
3284 | 3301 | /// Get various up-to-date metrics about the input system. |
|
0 commit comments