NWH Vehicle Physics 2
Search Results for

    Show / Hide Table of Contents

    Class VehicleInputActions

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

    Inheritance
    object
    VehicleInputActions
    Implements
    IInputActionCollection2
    IInputActionCollection
    IEnumerable<InputAction>
    IEnumerable
    IDisposable
    Namespace: NWH.VehiclePhysics2.Input
    Assembly: NWH.VehiclePhysics2.dll
    Syntax
    public class VehicleInputActions : 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

    VehicleInputActions()

    Constructs a new instance.

    Declaration
    public VehicleInputActions()

    Properties

    VehicleControls

    Provides a new VehicleInputActions.VehicleControlsActions instance referencing this action map.

    Declaration
    public VehicleInputActions.VehicleControlsActions VehicleControls { get; }
    Property Value
    Type Description
    VehicleInputActions.VehicleControlsActions

    asset

    Provides access to the underlying asset instance.

    Declaration
    public InputActionAsset asset { get; }
    Property Value
    Type Description
    InputActionAsset

    bindingMask

    Declaration
    public InputBinding? bindingMask { get; set; }
    Property Value
    Type Description
    InputBinding?

    bindings

    Declaration
    public IEnumerable<InputBinding> bindings { get; }
    Property Value
    Type Description
    IEnumerable<InputBinding>

    controlSchemes

    Declaration
    public ReadOnlyArray<InputControlScheme> controlSchemes { get; }
    Property Value
    Type Description
    ReadOnlyArray<InputControlScheme>

    devices

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

    Methods

    Contains(InputAction)

    Declaration
    public bool Contains(InputAction action)
    Parameters
    Type Name Description
    InputAction action
    Returns
    Type Description
    bool

    Disable()

    Declaration
    public void Disable()

    Dispose()

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

    Declaration
    public void Dispose()

    Enable()

    Declaration
    public void Enable()

    ~VehicleInputActions()

    Declaration
    protected ~VehicleInputActions()

    FindAction(string, bool)

    Declaration
    public InputAction FindAction(string actionNameOrId, bool throwIfNotFound = false)
    Parameters
    Type Name Description
    string actionNameOrId
    bool throwIfNotFound
    Returns
    Type Description
    InputAction

    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

    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
    In this article
    Back to top Copyright © NWH - Vehicle Physics, Aerodynamics, Dynamic Water Physics