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>
7720 public partial class @InGameHintsActions : IInputActionCollection2 , IDisposable
7821 {
79- /// <summary>
80- /// Provides access to the underlying asset instance.
81- /// </summary>
8222 public InputActionAsset asset { get ; }
83-
84- /// <summary>
85- /// Constructs a new instance.
86- /// </summary>
8723 public @InGameHintsActions ( )
8824 {
8925 asset = InputActionAsset . FromJson ( @"{
@@ -341,71 +277,57 @@ public @InGameHintsActions()
341277 UnityEngine . Debug . Assert ( ! m_Gameplay . enabled , "This will cause a leak and performance issues, InGameHintsActions.Gameplay.Disable() has not been called." ) ;
342278 }
343279
344- /// <summary>
345- /// Destroys this asset and all associated <see cref="InputAction"/> instances.
346- /// </summary>
347280 public void Dispose ( )
348281 {
349282 UnityEngine . Object . Destroy ( asset ) ;
350283 }
351284
352- /// <inheritdoc cref="UnityEngine.InputSystem.InputActionAsset.bindingMask" />
353285 public InputBinding ? bindingMask
354286 {
355287 get => asset . bindingMask ;
356288 set => asset . bindingMask = value ;
357289 }
358290
359- /// <inheritdoc cref="UnityEngine.InputSystem.InputActionAsset.devices" />
360291 public ReadOnlyArray < InputDevice > ? devices
361292 {
362293 get => asset . devices ;
363294 set => asset . devices = value ;
364295 }
365296
366- /// <inheritdoc cref="UnityEngine.InputSystem.InputActionAsset.controlSchemes" />
367297 public ReadOnlyArray < InputControlScheme > controlSchemes => asset . controlSchemes ;
368298
369- /// <inheritdoc cref="UnityEngine.InputSystem.InputActionAsset.Contains(InputAction)" />
370299 public bool Contains ( InputAction action )
371300 {
372301 return asset . Contains ( action ) ;
373302 }
374303
375- /// <inheritdoc cref="UnityEngine.InputSystem.InputActionAsset.GetEnumerator()" />
376304 public IEnumerator < InputAction > GetEnumerator ( )
377305 {
378306 return asset . GetEnumerator ( ) ;
379307 }
380308
381- /// <inheritdoc cref="IEnumerable.GetEnumerator()" />
382309 IEnumerator IEnumerable . GetEnumerator ( )
383310 {
384311 return GetEnumerator ( ) ;
385312 }
386313
387- /// <inheritdoc cref="UnityEngine.InputSystem.InputActionAsset.Enable()" />
388314 public void Enable ( )
389315 {
390316 asset . Enable ( ) ;
391317 }
392318
393- /// <inheritdoc cref="UnityEngine.InputSystem.InputActionAsset.Disable()" />
394319 public void Disable ( )
395320 {
396321 asset . Disable ( ) ;
397322 }
398323
399- /// <inheritdoc cref="UnityEngine.InputSystem.InputActionAsset.bindings" />
400324 public IEnumerable < InputBinding > bindings => asset . bindings ;
401325
402- /// <inheritdoc cref="UnityEngine.InputSystem.InputActionAsset.FindAction(string, bool)" />
403326 public InputAction FindAction ( string actionNameOrId , bool throwIfNotFound = false )
404327 {
405328 return asset . FindAction ( actionNameOrId , throwIfNotFound ) ;
406329 }
407330
408- /// <inheritdoc cref="UnityEngine.InputSystem.InputActionAsset.FindBinding(InputBinding, out InputAction)" />
409331 public int FindBinding ( InputBinding bindingMask , out InputAction action )
410332 {
411333 return asset . FindBinding ( bindingMask , out action ) ;
@@ -419,59 +341,20 @@ public int FindBinding(InputBinding bindingMask, out InputAction action)
419341 private readonly InputAction m_Gameplay_PickUp ;
420342 private readonly InputAction m_Gameplay_Drop ;
421343 private readonly InputAction m_Gameplay_Throw ;
422- /// <summary>
423- /// Provides access to input actions defined in input action map "Gameplay".
424- /// </summary>
425344 public struct GameplayActions
426345 {
427346 private @InGameHintsActions m_Wrapper ;
428-
429- /// <summary>
430- /// Construct a new instance of the input action map wrapper class.
431- /// </summary>
432347 public GameplayActions ( @InGameHintsActions wrapper ) { m_Wrapper = wrapper ; }
433- /// <summary>
434- /// Provides access to the underlying input action "Gameplay/Move".
435- /// </summary>
436348 public InputAction @Move => m_Wrapper . m_Gameplay_Move ;
437- /// <summary>
438- /// Provides access to the underlying input action "Gameplay/Look".
439- /// </summary>
440349 public InputAction @Look => m_Wrapper . m_Gameplay_Look ;
441- /// <summary>
442- /// Provides access to the underlying input action "Gameplay/PickUp".
443- /// </summary>
444350 public InputAction @PickUp => m_Wrapper . m_Gameplay_PickUp ;
445- /// <summary>
446- /// Provides access to the underlying input action "Gameplay/Drop".
447- /// </summary>
448351 public InputAction @Drop => m_Wrapper . m_Gameplay_Drop ;
449- /// <summary>
450- /// Provides access to the underlying input action "Gameplay/Throw".
451- /// </summary>
452352 public InputAction @Throw => m_Wrapper . m_Gameplay_Throw ;
453- /// <summary>
454- /// Provides access to the underlying input action map instance.
455- /// </summary>
456353 public InputActionMap Get ( ) { return m_Wrapper . m_Gameplay ; }
457- /// <inheritdoc cref="UnityEngine.InputSystem.InputActionMap.Enable()" />
458354 public void Enable ( ) { Get ( ) . Enable ( ) ; }
459- /// <inheritdoc cref="UnityEngine.InputSystem.InputActionMap.Disable()" />
460355 public void Disable ( ) { Get ( ) . Disable ( ) ; }
461- /// <inheritdoc cref="UnityEngine.InputSystem.InputActionMap.enabled" />
462356 public bool enabled => Get ( ) . enabled ;
463- /// <summary>
464- /// Implicitly converts an <see ref="GameplayActions" /> to an <see ref="InputActionMap" /> instance.
465- /// </summary>
466357 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" />
475358 public void AddCallbacks ( IGameplayActions instance )
476359 {
477360 if ( instance == null || m_Wrapper . m_GameplayActionsCallbackInterfaces . Contains ( instance ) ) return ;
@@ -493,13 +376,6 @@ public void AddCallbacks(IGameplayActions instance)
493376 @Throw . canceled += instance . OnThrow ;
494377 }
495378
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" />
503379 private void UnregisterCallbacks ( IGameplayActions instance )
504380 {
505381 @Move . started -= instance . OnMove ;
@@ -519,25 +395,12 @@ private void UnregisterCallbacks(IGameplayActions instance)
519395 @Throw . canceled -= instance . OnThrow ;
520396 }
521397
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)" />
526398 public void RemoveCallbacks ( IGameplayActions instance )
527399 {
528400 if ( m_Wrapper . m_GameplayActionsCallbackInterfaces . Remove ( instance ) )
529401 UnregisterCallbacks ( instance ) ;
530402 }
531403
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)" />
541404 public void SetCallbacks ( IGameplayActions instance )
542405 {
543406 foreach ( var item in m_Wrapper . m_GameplayActionsCallbackInterfaces )
@@ -546,15 +409,8 @@ public void SetCallbacks(IGameplayActions instance)
546409 AddCallbacks ( instance ) ;
547410 }
548411 }
549- /// <summary>
550- /// Provides a new <see cref="GameplayActions" /> instance referencing this action map.
551- /// </summary>
552412 public GameplayActions @Gameplay => new GameplayActions ( this ) ;
553413 private int m_GamepadSchemeIndex = - 1 ;
554- /// <summary>
555- /// Provides access to the input control scheme.
556- /// </summary>
557- /// <seealso cref="UnityEngine.InputSystem.InputControlScheme" />
558414 public InputControlScheme GamepadScheme
559415 {
560416 get
@@ -564,10 +420,6 @@ public InputControlScheme GamepadScheme
564420 }
565421 }
566422 private int m_KeyboardMouseSchemeIndex = - 1 ;
567- /// <summary>
568- /// Provides access to the input control scheme.
569- /// </summary>
570- /// <seealso cref="UnityEngine.InputSystem.InputControlScheme" />
571423 public InputControlScheme KeyboardMouseScheme
572424 {
573425 get
@@ -576,47 +428,12 @@ public InputControlScheme KeyboardMouseScheme
576428 return asset . controlSchemes [ m_KeyboardMouseSchemeIndex ] ;
577429 }
578430 }
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)" />
584431 public interface IGameplayActions
585432 {
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" />
592433 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" />
599434 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" />
606435 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" />
613436 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" />
620437 void OnThrow ( InputAction . CallbackContext context ) ;
621438 }
622439 }
0 commit comments