NWH Common
Search Results for

    Show / Hide Table of Contents

    Class SceneInputActions

    Provides programmatic access to UnityEngine.InputSystem.InputActionAsset, UnityEngine.InputSystem.InputActionMap, UnityEngine.InputSystem.InputAction and UnityEngine.InputSystem.InputControlScheme instances defined in asset "Packages/com.nwh.common/Runtime/Input/InputSystem/SceneInputActions.inputactions".

    Inheritance
    object
    SceneInputActions
    Implements
    IInputActionCollection2
    IInputActionCollection
    IEnumerable<InputAction>
    IEnumerable
    IDisposable
    Namespace: NWH.Common.Input
    Assembly: NWH.Common.dll
    Syntax
    public class SceneInputActions : IInputActionCollection2, IInputActionCollection, IEnumerable<InputAction>, IEnumerable, IDisposable
    Remarks

    This class is source generated and any manual edits will be discarded if the associated asset is reimported or modified.

    Examples
    using namespace UnityEngine;
    using UnityEngine.InputSystem;
    
    // Example of using an InputActionMap named "Player" from a UnityEngine.MonoBehaviour implementing callback interface.
    public class Example : MonoBehaviour, MyActions.IPlayerActions
    {
        private MyActions_Actions m_Actions;                  // Source code representation of asset.
        private MyActions_Actions.PlayerActions m_Player;     // Source code representation of action map.
    
        void Awake()
        {
            m_Actions = new MyActions_Actions();              // Create asset object.
            m_Player = m_Actions.Player;                      // Extract action map object.
            m_Player.AddCallbacks(this);                      // Register callback interface IPlayerActions.
        }
    
        void OnDestroy()
        {
            m_Actions.Dispose();                              // Destroy asset object.
        }
    
        void OnEnable()
        {
            m_Player.Enable();                                // Enable all actions within map.
        }
    
        void OnDisable()
        {
            m_Player.Disable();                               // Disable all actions within map.
        }
    
        #region Interface implementation of MyActions.IPlayerActions
    
        // Invoked when "Move" action is either started, performed or canceled.
        public void OnMove(InputAction.CallbackContext context)
        {
            Debug.Log($"OnMove: {context.ReadValue<Vector2>()}");
        }
    
        // Invoked when "Attack" action is either started, performed or canceled.
        public void OnAttack(InputAction.CallbackContext context)
        {
            Debug.Log($"OnAttack: {context.ReadValue<float>()}");
        }
    
        #endregion
    }

    Constructors

    | Edit this page View Source

    SceneInputActions()

    Constructs a new instance.

    Declaration
    public SceneInputActions()

    Properties

    | Edit this page View Source

    CameraControls

    Provides a new SceneInputActions.CameraControlsActions instance referencing this action map.

    Declaration
    public SceneInputActions.CameraControlsActions CameraControls { get; }
    Property Value
    Type Description
    SceneInputActions.CameraControlsActions
    | Edit this page View Source

    SceneControls

    Provides a new SceneInputActions.SceneControlsActions instance referencing this action map.

    Declaration
    public SceneInputActions.SceneControlsActions SceneControls { get; }
    Property Value
    Type Description
    SceneInputActions.SceneControlsActions
    | Edit this page View Source

    asset

    Provides access to the underlying asset instance.

    Declaration
    public InputActionAsset asset { get; }
    Property Value
    Type Description
    InputActionAsset
    | Edit this page View Source

    bindingMask

    Declaration
    public InputBinding? bindingMask { get; set; }
    Property Value
    Type Description
    InputBinding?
    | Edit this page View Source

    bindings

    Declaration
    public IEnumerable<InputBinding> bindings { get; }
    Property Value
    Type Description
    IEnumerable<InputBinding>
    | Edit this page View Source

    controlSchemes

    Declaration
    public ReadOnlyArray<InputControlScheme> controlSchemes { get; }
    Property Value
    Type Description
    ReadOnlyArray<InputControlScheme>
    | Edit this page View Source

    devices

    Declaration
    public ReadOnlyArray<InputDevice>? devices { get; set; }
    Property Value
    Type Description
    ReadOnlyArray<InputDevice>?

    Methods

    | Edit this page View Source

    Contains(InputAction)

    Declaration
    public bool Contains(InputAction action)
    Parameters
    Type Name Description
    InputAction action
    Returns
    Type Description
    bool
    | Edit this page View Source

    Disable()

    Declaration
    public void Disable()
    | Edit this page View Source

    Dispose()

    Destroys this asset and all associated UnityEngine.InputSystem.InputAction instances.

    Declaration
    public void Dispose()
    | Edit this page View Source

    Enable()

    Declaration
    public void Enable()
    | Edit this page View Source

    ~SceneInputActions()

    Declaration
    protected ~SceneInputActions()
    | Edit this page View Source

    FindAction(string, bool)

    Declaration
    public InputAction FindAction(string actionNameOrId, bool throwIfNotFound = false)
    Parameters
    Type Name Description
    string actionNameOrId
    bool throwIfNotFound
    Returns
    Type Description
    InputAction
    | Edit this page View Source

    FindBinding(InputBinding, out InputAction)

    Declaration
    public int FindBinding(InputBinding bindingMask, out InputAction action)
    Parameters
    Type Name Description
    InputBinding bindingMask
    InputAction action
    Returns
    Type Description
    int
    | Edit this page View Source

    GetEnumerator()

    Returns an enumerator that iterates through the collection.

    Declaration
    public IEnumerator<InputAction> GetEnumerator()
    Returns
    Type Description
    IEnumerator<InputAction>

    An enumerator that can be used to iterate through the collection.

    Implements

    UnityEngine.InputSystem.IInputActionCollection2
    UnityEngine.InputSystem.IInputActionCollection
    IEnumerable<T>
    IEnumerable
    IDisposable
    • Edit this page
    • View Source
    In this article
    Back to top Copyright © NWH - Vehicle Physics, Aerodynamics, Dynamic Water Physics