@@ -325,32 +325,14 @@ public static BindingSyntax AddBinding(this InputAction action, string path, str
325325 /// </remarks>
326326
327327 // Internal hook for Editor to register analytics tracking
328- internal static Action < int > s_ApiUsageCallback ;
328+ internal static Action < InputAnalytics . AuthoringApi > s_ApiUsageCallback ;
329329
330330 // Internal hook for Editor to suppress analytics
331331 internal static Action < bool > s_SuppressAnalytics ;
332332
333- // API constants for analytics (matches Editor InputExitPlayModeAnalytic.Api enum)
334- internal enum Api
333+ private static void RegisterAnalyticsApi ( InputAnalytics . AuthoringApi authoringApi )
335334 {
336- AddBinding ,
337- AddCompositeBinding ,
338- ChangeBinding ,
339- ChangeCompositeBinding ,
340- Rename ,
341- AddControlScheme ,
342- RemoveControlScheme ,
343- ControlSchemeWithBindingGroup ,
344- ControlSchemeWithDevice ,
345- ControlSchemeWithRequiredDevice ,
346- ControlSchemeWithOptionalDevice ,
347- ControlSchemeOrWithRequiredDevice ,
348- ControlSchemeOrWithOptionalDevice
349- }
350-
351- private static void RegisterAnalyticsApi ( int api )
352- {
353- s_ApiUsageCallback ? . Invoke ( api ) ;
335+ s_ApiUsageCallback ? . Invoke ( authoringApi ) ;
354336 }
355337
356338 /// <summary>
@@ -397,7 +379,7 @@ public static BindingSyntax AddBinding(this InputAction action, InputControl con
397379 public static BindingSyntax AddBinding ( this InputAction action , InputBinding binding = default )
398380 {
399381 #if UNITY_EDITOR
400- RegisterAnalyticsApi ( ( int ) Api . AddBinding ) ;
382+ RegisterAnalyticsApi ( InputAnalytics . AuthoringApi . AddBinding ) ;
401383 #endif
402384
403385 if ( action == null )
@@ -530,7 +512,7 @@ public static BindingSyntax AddBinding(this InputActionMap actionMap, string pat
530512 public static BindingSyntax AddBinding ( this InputActionMap actionMap , InputBinding binding )
531513 {
532514 #if UNITY_EDITOR
533- RegisterAnalyticsApi ( ( int ) Api . AddBinding ) ;
515+ RegisterAnalyticsApi ( InputAnalytics . AuthoringApi . AddBinding ) ;
534516 #endif
535517
536518 if ( actionMap == null )
@@ -557,7 +539,7 @@ public static CompositeSyntax AddCompositeBinding(this InputAction action, strin
557539 string interactions = null , string processors = null )
558540 {
559541 #if UNITY_EDITOR
560- RegisterAnalyticsApi ( ( int ) Api . AddCompositeBinding ) ;
542+ RegisterAnalyticsApi ( InputAnalytics . AuthoringApi . AddCompositeBinding ) ;
561543 #endif
562544
563545 if ( action == null )
@@ -640,7 +622,7 @@ private static int AddBindingInternal(InputActionMap map, InputBinding binding,
640622 public static BindingSyntax ChangeBinding ( this InputAction action , int index )
641623 {
642624 #if UNITY_EDITOR
643- RegisterAnalyticsApi ( ( int ) Api . ChangeBinding ) ;
625+ RegisterAnalyticsApi ( InputAnalytics . AuthoringApi . ChangeBinding ) ;
644626 #endif
645627
646628 if ( action == null )
@@ -702,7 +684,7 @@ public static BindingSyntax ChangeBinding(this InputAction action, string name)
702684 public static BindingSyntax ChangeBinding ( this InputActionMap actionMap , int index )
703685 {
704686 #if UNITY_EDITOR
705- RegisterAnalyticsApi ( ( int ) Api . ChangeBinding ) ;
687+ RegisterAnalyticsApi ( InputAnalytics . AuthoringApi . ChangeBinding ) ;
706688 #endif
707689
708690 if ( actionMap == null )
@@ -904,7 +886,7 @@ public static BindingSyntax ChangeBinding(this InputAction action, InputBinding
904886 public static BindingSyntax ChangeCompositeBinding ( this InputAction action , string compositeName )
905887 {
906888 #if UNITY_EDITOR
907- RegisterAnalyticsApi ( ( int ) Api . ChangeCompositeBinding ) ;
889+ RegisterAnalyticsApi ( InputAnalytics . AuthoringApi . ChangeCompositeBinding ) ;
908890 #endif
909891
910892 if ( action == null )
@@ -949,7 +931,7 @@ public static BindingSyntax ChangeCompositeBinding(this InputAction action, stri
949931 public static void Rename ( this InputAction action , string newName )
950932 {
951933 #if UNITY_EDITOR
952- RegisterAnalyticsApi ( ( int ) Api . Rename ) ;
934+ RegisterAnalyticsApi ( InputAnalytics . AuthoringApi . Rename ) ;
953935 #endif
954936
955937 if ( action == null )
@@ -995,7 +977,7 @@ public static void Rename(this InputAction action, string newName)
995977 public static void AddControlScheme ( this InputActionAsset asset , InputControlScheme controlScheme )
996978 {
997979 #if UNITY_EDITOR
998- RegisterAnalyticsApi ( ( int ) Api . AddControlScheme ) ;
980+ RegisterAnalyticsApi ( InputAnalytics . AuthoringApi . AddControlScheme ) ;
999981 #endif
1000982
1001983 if ( asset == null )
@@ -1067,7 +1049,7 @@ public static ControlSchemeSyntax AddControlScheme(this InputActionAsset asset,
10671049 public static void RemoveControlScheme ( this InputActionAsset asset , string name )
10681050 {
10691051 #if UNITY_EDITOR
1070- RegisterAnalyticsApi ( ( int ) Api . RemoveControlScheme ) ;
1052+ RegisterAnalyticsApi ( InputAnalytics . AuthoringApi . RemoveControlScheme ) ;
10711053 #endif
10721054
10731055 if ( asset == null )
@@ -1091,7 +1073,7 @@ public static void RemoveControlScheme(this InputActionAsset asset, string name)
10911073 public static InputControlScheme WithBindingGroup ( this InputControlScheme scheme , string bindingGroup )
10921074 {
10931075 #if UNITY_EDITOR
1094- RegisterAnalyticsApi ( ( int ) Api . ControlSchemeWithBindingGroup ) ;
1076+ RegisterAnalyticsApi ( InputAnalytics . AuthoringApi . ControlSchemeWithBindingGroup ) ;
10951077 #endif
10961078
10971079 return new ControlSchemeSyntax ( scheme ) . WithBindingGroup ( bindingGroup ) . Done ( ) ;
@@ -1100,7 +1082,7 @@ public static InputControlScheme WithBindingGroup(this InputControlScheme scheme
11001082 public static InputControlScheme WithDevice ( this InputControlScheme scheme , string controlPath , bool required )
11011083 {
11021084 #if UNITY_EDITOR
1103- RegisterAnalyticsApi ( ( int ) Api . ControlSchemeWithDevice ) ;
1085+ RegisterAnalyticsApi ( InputAnalytics . AuthoringApi . ControlSchemeWithDevice ) ;
11041086 #endif
11051087
11061088 if ( required )
@@ -1111,7 +1093,7 @@ public static InputControlScheme WithDevice(this InputControlScheme scheme, stri
11111093 public static InputControlScheme WithRequiredDevice ( this InputControlScheme scheme , string controlPath )
11121094 {
11131095 #if UNITY_EDITOR
1114- RegisterAnalyticsApi ( ( int ) Api . ControlSchemeWithRequiredDevice ) ;
1096+ RegisterAnalyticsApi ( InputAnalytics . AuthoringApi . ControlSchemeWithRequiredDevice ) ;
11151097 #endif
11161098
11171099 return new ControlSchemeSyntax ( scheme ) . WithRequiredDevice ( controlPath ) . Done ( ) ;
@@ -1120,7 +1102,7 @@ public static InputControlScheme WithRequiredDevice(this InputControlScheme sche
11201102 public static InputControlScheme WithOptionalDevice ( this InputControlScheme scheme , string controlPath )
11211103 {
11221104 #if UNITY_EDITOR
1123- RegisterAnalyticsApi ( ( int ) Api . ControlSchemeWithOptionalDevice ) ;
1105+ RegisterAnalyticsApi ( InputAnalytics . AuthoringApi . ControlSchemeWithOptionalDevice ) ;
11241106 #endif
11251107
11261108 return new ControlSchemeSyntax ( scheme ) . WithOptionalDevice ( controlPath ) . Done ( ) ;
@@ -1129,7 +1111,7 @@ public static InputControlScheme WithOptionalDevice(this InputControlScheme sche
11291111 public static InputControlScheme OrWithRequiredDevice ( this InputControlScheme scheme , string controlPath )
11301112 {
11311113 #if UNITY_EDITOR
1132- RegisterAnalyticsApi ( ( int ) Api . ControlSchemeOrWithRequiredDevice ) ;
1114+ RegisterAnalyticsApi ( InputAnalytics . AuthoringApi . ControlSchemeOrWithRequiredDevice ) ;
11331115 #endif
11341116
11351117 return new ControlSchemeSyntax ( scheme ) . OrWithRequiredDevice ( controlPath ) . Done ( ) ;
@@ -1138,7 +1120,7 @@ public static InputControlScheme OrWithRequiredDevice(this InputControlScheme sc
11381120 public static InputControlScheme OrWithOptionalDevice ( this InputControlScheme scheme , string controlPath )
11391121 {
11401122 #if UNITY_EDITOR
1141- RegisterAnalyticsApi ( ( int ) Api . ControlSchemeOrWithOptionalDevice ) ;
1123+ RegisterAnalyticsApi ( InputAnalytics . AuthoringApi . ControlSchemeOrWithOptionalDevice ) ;
11421124 #endif
11431125
11441126 return new ControlSchemeSyntax ( scheme ) . OrWithOptionalDevice ( controlPath ) . Done ( ) ;
0 commit comments