File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
Packages/com.unity.inputsystem/InputSystem/Actions Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change 11using System ;
22using Unity . Collections . LowLevel . Unsafe ;
3+ using Unity . Profiling ;
34using UnityEngine . InputSystem . Controls ;
45using UnityEngine . InputSystem . LowLevel ;
56using UnityEngine . InputSystem . Utilities ;
@@ -681,6 +682,11 @@ public bool wantsInitialStateCheck
681682 }
682683 }
683684
685+ /// <summary>
686+ /// ProfilerMarker for measuring the enabling/disabling of InputActions.
687+ /// </summary>
688+ static readonly ProfilerMarker k_InputActionEnableProfilerMarker = new ProfilerMarker ( "InputAction.Enable" ) ;
689+
684690 /// <summary>
685691 /// Construct an unnamed, free-standing action that is not part of any map or asset
686692 /// and has no bindings. Bindings can be added with <see
@@ -902,6 +908,7 @@ public void Enable()
902908 if ( enabled )
903909 return ;
904910
911+ k_InputActionEnableProfilerMarker . Auto ( ) ;
905912 // For singleton actions, we create an internal-only InputActionMap
906913 // private to the action.
907914 var map = GetOrCreateActionMap ( ) ;
Original file line number Diff line number Diff line change 33using System . Collections . Generic ;
44using System . Linq ;
55using Unity . Collections ;
6+ using Unity . Profiling ;
67using UnityEngine . InputSystem . Utilities ;
78
89////REVIEW: given we have the global ActionPerformed callback, do we really need the per-map callback?
@@ -313,6 +314,11 @@ public event Action<InputAction.CallbackContext> actionTriggered
313314 remove => m_ActionCallbacks . RemoveCallback ( value ) ;
314315 }
315316
317+ /// <summary>
318+ /// ProfilerMarker to measure how long it takes to resolve bindings.
319+ /// </summary>
320+ static readonly ProfilerMarker k_ResolveBindingsProfilerMarker = new ( "InputActionMap.ResolveBindings" ) ;
321+
316322 /// <summary>
317323 /// Construct an action map with default values.
318324 /// </summary>
@@ -1299,6 +1305,7 @@ internal bool ResolveBindingsIfNecessary()
12991305 /// </remarks>
13001306 internal void ResolveBindings ( )
13011307 {
1308+ k_ResolveBindingsProfilerMarker . Auto ( ) ;
13021309 // Make sure that if we trigger callbacks as part of disabling and re-enabling actions,
13031310 // we don't trigger a re-resolve while we're already resolving bindings.
13041311 using ( InputActionRebindingExtensions . DeferBindingResolution ( ) )
You can’t perform that action at this time.
0 commit comments