1717
1818namespace UnityEngine . InputSystem . Samples . InGameHints
1919{
20+ /// <summary>
21+ /// Provides programmatic access to <see cref="InputActionAsset" />, <see cref="InputActionMap" />, <see cref="InputAction" /> and <see cref="InputControlScheme" /> instances defined in asset "Assets/Samples/InGameHints/InGameHintsActions.inputactions".
22+ /// </summary>
23+ /// <remarks>
24+ /// This class is source generated and any manual edits will be discarded if the associated asset is reimported or modified.
25+ /// </remarks>
26+ /// <example>
27+ /// <code>
28+ /// using namespace UnityEngine;
29+ /// using UnityEngine.InputSystem;
30+ ///
31+ /// // Example of using an InputActionMap named "Player" from a UnityEngine.MonoBehaviour implementing callback interface.
32+ /// public class Example : MonoBehaviour, MyActions.IPlayerActions
33+ /// {
34+ /// private MyActions_Actions m_Actions; // Source code representation of asset.
35+ /// private MyActions_Actions.PlayerActions m_Player; // Source code representation of action map.
36+ ///
37+ /// void Awake()
38+ /// {
39+ /// m_Actions = new MyActions_Actions(); // Create asset object.
40+ /// m_Player = m_Actions.Player; // Extract action map object.
41+ /// m_Player.AddCallbacks(this); // Register callback interface IPlayerActions.
42+ /// }
43+ ///
44+ /// void OnDestroy()
45+ /// {
46+ /// m_Actions.Dispose(); // Destroy asset object.
47+ /// }
48+ ///
49+ /// void OnEnable()
50+ /// {
51+ /// m_Player.Enable(); // Enable all actions within map.
52+ /// }
53+ ///
54+ /// void OnDisable()
55+ /// {
56+ /// m_Player.Disable(); // Disable all actions within map.
57+ /// }
58+ ///
59+ /// #region Interface implementation of MyActions.IPlayerActions
60+ ///
61+ /// // Invoked when "Move" action is either started, performed or canceled.
62+ /// public void OnMove(InputAction.CallbackContext context)
63+ /// {
64+ /// Debug.Log($"OnMove: {context.ReadValue<Vector2>()}");
65+ /// }
66+ ///
67+ /// // Invoked when "Attack" action is either started, performed or canceled.
68+ /// public void OnAttack(InputAction.CallbackContext context)
69+ /// {
70+ /// Debug.Log($"OnAttack: {context.ReadValue<float>()}");
71+ /// }
72+ ///
73+ /// #endregion
74+ /// }
75+ /// </code>
76+ /// </example>
2077 public partial class @InGameHintsActions : IInputActionCollection2 , IDisposable
2178 {
79+ /// <summary>
80+ /// Provides access to the underlying asset instance.
81+ /// </summary>
2282 public InputActionAsset asset { get ; }
83+
84+ /// <summary>
85+ /// Constructs a new instance.
86+ /// </summary>
2387 public @InGameHintsActions ( )
2488 {
2589 asset = InputActionAsset . FromJson ( @"{
@@ -277,57 +341,71 @@ public @InGameHintsActions()
277341 UnityEngine . Debug . Assert ( ! m_Gameplay . enabled , "This will cause a leak and performance issues, InGameHintsActions.Gameplay.Disable() has not been called." ) ;
278342 }
279343
344+ /// <summary>
345+ /// Destroys this asset and all associated <see cref="InputAction"/> instances.
346+ /// </summary>
280347 public void Dispose ( )
281348 {
282349 UnityEngine . Object . Destroy ( asset ) ;
283350 }
284351
352+ /// <inheritdoc cref="UnityEngine.InputSystem.InputActionAsset.bindingMask" />
285353 public InputBinding ? bindingMask
286354 {
287355 get => asset . bindingMask ;
288356 set => asset . bindingMask = value ;
289357 }
290358
359+ /// <inheritdoc cref="UnityEngine.InputSystem.InputActionAsset.devices" />
291360 public ReadOnlyArray < InputDevice > ? devices
292361 {
293362 get => asset . devices ;
294363 set => asset . devices = value ;
295364 }
296365
366+ /// <inheritdoc cref="UnityEngine.InputSystem.InputActionAsset.controlSchemes" />
297367 public ReadOnlyArray < InputControlScheme > controlSchemes => asset . controlSchemes ;
298368
369+ /// <inheritdoc cref="UnityEngine.InputSystem.InputActionAsset.Contains(InputAction)" />
299370 public bool Contains ( InputAction action )
300371 {
301372 return asset . Contains ( action ) ;
302373 }
303374
375+ /// <inheritdoc cref="UnityEngine.InputSystem.InputActionAsset.GetEnumerator()" />
304376 public IEnumerator < InputAction > GetEnumerator ( )
305377 {
306378 return asset . GetEnumerator ( ) ;
307379 }
308380
381+ /// <inheritdoc cref="IEnumerable.GetEnumerator()" />
309382 IEnumerator IEnumerable . GetEnumerator ( )
310383 {
311384 return GetEnumerator ( ) ;
312385 }
313386
387+ /// <inheritdoc cref="UnityEngine.InputSystem.InputActionAsset.Enable()" />
314388 public void Enable ( )
315389 {
316390 asset . Enable ( ) ;
317391 }
318392
393+ /// <inheritdoc cref="UnityEngine.InputSystem.InputActionAsset.Disable()" />
319394 public void Disable ( )
320395 {
321396 asset . Disable ( ) ;
322397 }
323398
399+ /// <inheritdoc cref="UnityEngine.InputSystem.InputActionAsset.bindings" />
324400 public IEnumerable < InputBinding > bindings => asset . bindings ;
325401
402+ /// <inheritdoc cref="UnityEngine.InputSystem.InputActionAsset.FindAction(string, bool)" />
326403 public InputAction FindAction ( string actionNameOrId , bool throwIfNotFound = false )
327404 {
328405 return asset . FindAction ( actionNameOrId , throwIfNotFound ) ;
329406 }
330407
408+ /// <inheritdoc cref="UnityEngine.InputSystem.InputActionAsset.FindBinding(InputBinding, out InputAction)" />
331409 public int FindBinding ( InputBinding bindingMask , out InputAction action )
332410 {
333411 return asset . FindBinding ( bindingMask , out action ) ;
@@ -341,20 +419,59 @@ public int FindBinding(InputBinding bindingMask, out InputAction action)
341419 private readonly InputAction m_Gameplay_PickUp ;
342420 private readonly InputAction m_Gameplay_Drop ;
343421 private readonly InputAction m_Gameplay_Throw ;
422+ /// <summary>
423+ /// Provides access to input actions defined in input action map "Gameplay".
424+ /// </summary>
344425 public struct GameplayActions
345426 {
346427 private @InGameHintsActions m_Wrapper ;
428+
429+ /// <summary>
430+ /// Construct a new instance of the input action map wrapper class.
431+ /// </summary>
347432 public GameplayActions ( @InGameHintsActions wrapper ) { m_Wrapper = wrapper ; }
433+ /// <summary>
434+ /// Provides access to the underlying input action "Gameplay/Move".
435+ /// </summary>
348436 public InputAction @Move => m_Wrapper . m_Gameplay_Move ;
437+ /// <summary>
438+ /// Provides access to the underlying input action "Gameplay/Look".
439+ /// </summary>
349440 public InputAction @Look => m_Wrapper . m_Gameplay_Look ;
441+ /// <summary>
442+ /// Provides access to the underlying input action "Gameplay/PickUp".
443+ /// </summary>
350444 public InputAction @PickUp => m_Wrapper . m_Gameplay_PickUp ;
445+ /// <summary>
446+ /// Provides access to the underlying input action "Gameplay/Drop".
447+ /// </summary>
351448 public InputAction @Drop => m_Wrapper . m_Gameplay_Drop ;
449+ /// <summary>
450+ /// Provides access to the underlying input action "Gameplay/Throw".
451+ /// </summary>
352452 public InputAction @Throw => m_Wrapper . m_Gameplay_Throw ;
453+ /// <summary>
454+ /// Provides access to the underlying input action map instance.
455+ /// </summary>
353456 public InputActionMap Get ( ) { return m_Wrapper . m_Gameplay ; }
457+ /// <inheritdoc cref="UnityEngine.InputSystem.InputActionMap.Enable()" />
354458 public void Enable ( ) { Get ( ) . Enable ( ) ; }
459+ /// <inheritdoc cref="UnityEngine.InputSystem.InputActionMap.Disable()" />
355460 public void Disable ( ) { Get ( ) . Disable ( ) ; }
461+ /// <inheritdoc cref="UnityEngine.InputSystem.InputActionMap.enabled" />
356462 public bool enabled => Get ( ) . enabled ;
463+ /// <summary>
464+ /// Implicitly converts an <see ref="GameplayActions" /> to an <see ref="InputActionMap" /> instance.
465+ /// </summary>
357466 public static implicit operator InputActionMap ( GameplayActions set ) { return set . Get ( ) ; }
467+ /// <summary>
468+ /// Adds <see cref="InputAction.started"/>, <see cref="InputAction.performed"/> and <see cref="InputAction.canceled"/> callbacks provided via <param cref="instance" /> on all input actions contained in this map.
469+ /// </summary>
470+ /// <param name="instance">Callback instance.</param>
471+ /// <remarks>
472+ /// If <paramref name="instance" /> is <c>null</c> or <paramref name="instance"/> have already been added this method does nothing.
473+ /// </remarks>
474+ /// <seealso cref="GameplayActions" />
358475 public void AddCallbacks ( IGameplayActions instance )
359476 {
360477 if ( instance == null || m_Wrapper . m_GameplayActionsCallbackInterfaces . Contains ( instance ) ) return ;
@@ -376,6 +493,13 @@ public void AddCallbacks(IGameplayActions instance)
376493 @Throw . canceled += instance . OnThrow ;
377494 }
378495
496+ /// <summary>
497+ /// Removes <see cref="InputAction.started"/>, <see cref="InputAction.performed"/> and <see cref="InputAction.canceled"/> callbacks provided via <param cref="instance" /> on all input actions contained in this map.
498+ /// </summary>
499+ /// <remarks>
500+ /// Calling this method when <paramref name="instance" /> have not previously been registered has no side-effects.
501+ /// </remarks>
502+ /// <seealso cref="GameplayActions" />
379503 private void UnregisterCallbacks ( IGameplayActions instance )
380504 {
381505 @Move . started -= instance . OnMove ;
@@ -395,12 +519,25 @@ private void UnregisterCallbacks(IGameplayActions instance)
395519 @Throw . canceled -= instance . OnThrow ;
396520 }
397521
522+ /// <summary>
523+ /// Unregisters <param cref="instance" /> and unregisters all input action callbacks via <see cref="GameplayActions.UnregisterCallbacks(IGameplayActions)" />.
524+ /// </summary>
525+ /// <seealso cref="GameplayActions.UnregisterCallbacks(IGameplayActions)" />
398526 public void RemoveCallbacks ( IGameplayActions instance )
399527 {
400528 if ( m_Wrapper . m_GameplayActionsCallbackInterfaces . Remove ( instance ) )
401529 UnregisterCallbacks ( instance ) ;
402530 }
403531
532+ /// <summary>
533+ /// Replaces all existing callback instances and previously registered input action callbacks associated with them with callbacks provided via <param cref="instance" />.
534+ /// </summary>
535+ /// <remarks>
536+ /// If <paramref name="instance" /> is <c>null</c>, calling this method will only unregister all existing callbacks but not register any new callbacks.
537+ /// </remarks>
538+ /// <seealso cref="GameplayActions.AddCallbacks(IGameplayActions)" />
539+ /// <seealso cref="GameplayActions.RemoveCallbacks(IGameplayActions)" />
540+ /// <seealso cref="GameplayActions.UnregisterCallbacks(IGameplayActions)" />
404541 public void SetCallbacks ( IGameplayActions instance )
405542 {
406543 foreach ( var item in m_Wrapper . m_GameplayActionsCallbackInterfaces )
@@ -409,8 +546,15 @@ public void SetCallbacks(IGameplayActions instance)
409546 AddCallbacks ( instance ) ;
410547 }
411548 }
549+ /// <summary>
550+ /// Provides a new <see cref="GameplayActions" /> instance referencing this action map.
551+ /// </summary>
412552 public GameplayActions @Gameplay => new GameplayActions ( this ) ;
413553 private int m_GamepadSchemeIndex = - 1 ;
554+ /// <summary>
555+ /// Provides access to the input control scheme.
556+ /// </summary>
557+ /// <seealso cref="UnityEngine.InputSystem.InputControlScheme" />
414558 public InputControlScheme GamepadScheme
415559 {
416560 get
@@ -420,6 +564,10 @@ public InputControlScheme GamepadScheme
420564 }
421565 }
422566 private int m_KeyboardMouseSchemeIndex = - 1 ;
567+ /// <summary>
568+ /// Provides access to the input control scheme.
569+ /// </summary>
570+ /// <seealso cref="UnityEngine.InputSystem.InputControlScheme" />
423571 public InputControlScheme KeyboardMouseScheme
424572 {
425573 get
@@ -428,12 +576,47 @@ public InputControlScheme KeyboardMouseScheme
428576 return asset . controlSchemes [ m_KeyboardMouseSchemeIndex ] ;
429577 }
430578 }
579+ /// <summary>
580+ /// Interface to implement callback methods for all input action callbacks associated with input actions defined by "Gameplay" which allows adding and removing callbacks.
581+ /// </summary>
582+ /// <seealso cref="GameplayActions.AddCallbacks(IGameplayActions)" />
583+ /// <seealso cref="GameplayActions.RemoveCallbacks(IGameplayActions)" />
431584 public interface IGameplayActions
432585 {
586+ /// <summary>
587+ /// Method invoked when associated input action "Move" is either <see cref="UnityEngine.InputSystem.InputAction.started" />, <see cref="UnityEngine.InputSystem.InputAction.performed" /> or <see cref="UnityEngine.InputSystem.InputAction.canceled" />.
588+ /// </summary>
589+ /// <seealso cref="UnityEngine.InputSystem.InputAction.started" />
590+ /// <seealso cref="UnityEngine.InputSystem.InputAction.performed" />
591+ /// <seealso cref="UnityEngine.InputSystem.InputAction.canceled" />
433592 void OnMove ( InputAction . CallbackContext context ) ;
593+ /// <summary>
594+ /// Method invoked when associated input action "Look" is either <see cref="UnityEngine.InputSystem.InputAction.started" />, <see cref="UnityEngine.InputSystem.InputAction.performed" /> or <see cref="UnityEngine.InputSystem.InputAction.canceled" />.
595+ /// </summary>
596+ /// <seealso cref="UnityEngine.InputSystem.InputAction.started" />
597+ /// <seealso cref="UnityEngine.InputSystem.InputAction.performed" />
598+ /// <seealso cref="UnityEngine.InputSystem.InputAction.canceled" />
434599 void OnLook ( InputAction . CallbackContext context ) ;
600+ /// <summary>
601+ /// Method invoked when associated input action "PickUp" is either <see cref="UnityEngine.InputSystem.InputAction.started" />, <see cref="UnityEngine.InputSystem.InputAction.performed" /> or <see cref="UnityEngine.InputSystem.InputAction.canceled" />.
602+ /// </summary>
603+ /// <seealso cref="UnityEngine.InputSystem.InputAction.started" />
604+ /// <seealso cref="UnityEngine.InputSystem.InputAction.performed" />
605+ /// <seealso cref="UnityEngine.InputSystem.InputAction.canceled" />
435606 void OnPickUp ( InputAction . CallbackContext context ) ;
607+ /// <summary>
608+ /// Method invoked when associated input action "Drop" is either <see cref="UnityEngine.InputSystem.InputAction.started" />, <see cref="UnityEngine.InputSystem.InputAction.performed" /> or <see cref="UnityEngine.InputSystem.InputAction.canceled" />.
609+ /// </summary>
610+ /// <seealso cref="UnityEngine.InputSystem.InputAction.started" />
611+ /// <seealso cref="UnityEngine.InputSystem.InputAction.performed" />
612+ /// <seealso cref="UnityEngine.InputSystem.InputAction.canceled" />
436613 void OnDrop ( InputAction . CallbackContext context ) ;
614+ /// <summary>
615+ /// Method invoked when associated input action "Throw" is either <see cref="UnityEngine.InputSystem.InputAction.started" />, <see cref="UnityEngine.InputSystem.InputAction.performed" /> or <see cref="UnityEngine.InputSystem.InputAction.canceled" />.
616+ /// </summary>
617+ /// <seealso cref="UnityEngine.InputSystem.InputAction.started" />
618+ /// <seealso cref="UnityEngine.InputSystem.InputAction.performed" />
619+ /// <seealso cref="UnityEngine.InputSystem.InputAction.canceled" />
437620 void OnThrow ( InputAction . CallbackContext context ) ;
438621 }
439622 }
0 commit comments