TopDown Engine v5.0
Loading...
Searching...
No Matches
MoreMountains.TopDownEngine.TopDownEngineInputActions Class Reference

Provides programmatic access to InputActionAsset, InputActionMap, InputAction and InputControlScheme instances defined in asset "Assets/TopDownEngine/Common/ScriptsInputSystem/InputActions/TopDownEngineInputActions.inputactions". More...

Inheritance diagram for MoreMountains.TopDownEngine.TopDownEngineInputActions:

Classes

interface  IPlayerControlsActions
 Interface to implement callback methods for all input action callbacks associated with input actions defined by "PlayerControls" which allows adding and removing callbacks. More...
struct  PlayerControlsActions
 Provides access to input actions defined in input action map "PlayerControls". More...

Public Member Functions

 TopDownEngineInputActions ()
 Constructs a new instance.
void Dispose ()
 Destroys this asset and all associated InputAction instances.
bool Contains (InputAction action)
IEnumerator< InputAction > GetEnumerator ()
void Enable ()
void Disable ()
InputAction FindAction (string actionNameOrId, bool throwIfNotFound=false)
int FindBinding (InputBinding bindingMask, out InputAction action)

Properties

InputActionAsset asset [get]
 Provides access to the underlying asset instance.
InputBinding? bindingMask [get, set]
ReadOnlyArray< InputDevice >? devices [get, set]
ReadOnlyArray< InputControlScheme > controlSchemes [get]
IEnumerable< InputBinding > bindings [get]
PlayerControlsActions PlayerControls [get]
 Provides a new PlayerControlsActions instance referencing this action map.
InputControlScheme KeyboardScheme [get]
 Provides access to the input control scheme.
InputControlScheme GamepadScheme [get]
 Provides access to the input control scheme.

Detailed Description

Provides programmatic access to InputActionAsset, InputActionMap, InputAction and InputControlScheme instances defined in asset "Assets/TopDownEngine/Common/ScriptsInputSystem/InputActions/TopDownEngineInputActions.inputactions".

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

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
}
UnityEngine.Debug Debug
Definition MMDebug.cs:8

Constructor & Destructor Documentation

◆ TopDownEngineInputActions()

MoreMountains.TopDownEngine.TopDownEngineInputActions.TopDownEngineInputActions ( )

Constructs a new instance.

Member Function Documentation

◆ Contains()

bool MoreMountains.TopDownEngine.TopDownEngineInputActions.Contains ( InputAction action)

◆ Disable()

void MoreMountains.TopDownEngine.TopDownEngineInputActions.Disable ( )

◆ Dispose()

void MoreMountains.TopDownEngine.TopDownEngineInputActions.Dispose ( )

Destroys this asset and all associated InputAction instances.

◆ Enable()

void MoreMountains.TopDownEngine.TopDownEngineInputActions.Enable ( )

◆ FindAction()

InputAction MoreMountains.TopDownEngine.TopDownEngineInputActions.FindAction ( string actionNameOrId,
bool throwIfNotFound = false )

◆ FindBinding()

int MoreMountains.TopDownEngine.TopDownEngineInputActions.FindBinding ( InputBinding bindingMask,
out InputAction action )

◆ GetEnumerator()

IEnumerator< InputAction > MoreMountains.TopDownEngine.TopDownEngineInputActions.GetEnumerator ( )

Property Documentation

◆ asset

InputActionAsset MoreMountains.TopDownEngine.TopDownEngineInputActions.asset
get

Provides access to the underlying asset instance.

◆ bindingMask

InputBinding? MoreMountains.TopDownEngine.TopDownEngineInputActions.bindingMask
getset

◆ bindings

IEnumerable<InputBinding> MoreMountains.TopDownEngine.TopDownEngineInputActions.bindings
get

◆ controlSchemes

ReadOnlyArray<InputControlScheme> MoreMountains.TopDownEngine.TopDownEngineInputActions.controlSchemes
get

◆ devices

ReadOnlyArray<InputDevice>? MoreMountains.TopDownEngine.TopDownEngineInputActions.devices
getset

◆ GamepadScheme

InputControlScheme MoreMountains.TopDownEngine.TopDownEngineInputActions.GamepadScheme
get

Provides access to the input control scheme.

See also
UnityEngine.InputSystem.InputControlScheme

◆ KeyboardScheme

InputControlScheme MoreMountains.TopDownEngine.TopDownEngineInputActions.KeyboardScheme
get

Provides access to the input control scheme.

See also
UnityEngine.InputSystem.InputControlScheme

◆ PlayerControls

PlayerControlsActions MoreMountains.TopDownEngine.TopDownEngineInputActions.PlayerControls
get

Provides a new PlayerControlsActions instance referencing this action map.


The documentation for this class was generated from the following file: