896 lines
42 KiB
C#
896 lines
42 KiB
C#
//------------------------------------------------------------------------------
|
|
// <auto-generated>
|
|
// This code was auto-generated by com.unity.inputsystem:InputActionCodeGenerator
|
|
// version 1.18.0
|
|
// from Assets/Input/GameInput.inputactions
|
|
//
|
|
// Changes to this file may cause incorrect behavior and will be lost if
|
|
// the code is regenerated.
|
|
// </auto-generated>
|
|
//------------------------------------------------------------------------------
|
|
|
|
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine.InputSystem;
|
|
using UnityEngine.InputSystem.Utilities;
|
|
|
|
/// <summary>
|
|
/// Provides programmatic access to <see cref="InputActionAsset" />, <see cref="InputActionMap" />, <see cref="InputAction" /> and <see cref="InputControlScheme" /> instances defined in asset "Assets/Input/GameInput.inputactions".
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// This class is source generated and any manual edits will be discarded if the associated asset is reimported or modified.
|
|
/// </remarks>
|
|
/// <example>
|
|
/// <code>
|
|
/// 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
|
|
/// }
|
|
/// </code>
|
|
/// </example>
|
|
public partial class @GameInput: IInputActionCollection2, IDisposable
|
|
{
|
|
/// <summary>
|
|
/// Provides access to the underlying asset instance.
|
|
/// </summary>
|
|
public InputActionAsset asset { get; }
|
|
|
|
/// <summary>
|
|
/// Constructs a new instance.
|
|
/// </summary>
|
|
public @GameInput()
|
|
{
|
|
asset = InputActionAsset.FromJson(@"{
|
|
""version"": 1,
|
|
""name"": ""GameInput"",
|
|
""maps"": [
|
|
{
|
|
""name"": ""Menu"",
|
|
""id"": ""6ee4e6e2-2942-4180-934b-b99b39672dea"",
|
|
""actions"": [
|
|
{
|
|
""name"": ""Scroll"",
|
|
""type"": ""PassThrough"",
|
|
""id"": ""11b6e4fe-77a3-4a8d-b22b-8ba3b3b55b13"",
|
|
""expectedControlType"": ""Axis"",
|
|
""processors"": """",
|
|
""interactions"": """",
|
|
""initialStateCheck"": true
|
|
},
|
|
{
|
|
""name"": ""Down"",
|
|
""type"": ""Button"",
|
|
""id"": ""7c2b9493-5b9f-4ffa-8b1d-6398f5c3b5f2"",
|
|
""expectedControlType"": """",
|
|
""processors"": """",
|
|
""interactions"": """",
|
|
""initialStateCheck"": false
|
|
},
|
|
{
|
|
""name"": ""Up"",
|
|
""type"": ""Button"",
|
|
""id"": ""de1dc3c5-500d-4ab4-9a72-1ea6231e952b"",
|
|
""expectedControlType"": """",
|
|
""processors"": """",
|
|
""interactions"": """",
|
|
""initialStateCheck"": false
|
|
}
|
|
],
|
|
""bindings"": [
|
|
{
|
|
""name"": """",
|
|
""id"": ""14b76e42-70e9-46d7-a085-7d766ea271ce"",
|
|
""path"": ""<Mouse>/scroll/y"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""Scroll"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": false
|
|
},
|
|
{
|
|
""name"": """",
|
|
""id"": ""781dbf8d-1d9e-422f-8128-f00384c1d7f2"",
|
|
""path"": ""<Joystick>/stick/y"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""Scroll"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": false
|
|
},
|
|
{
|
|
""name"": """",
|
|
""id"": ""12d05a04-4af3-4dcb-ab2f-6f3b11e2cc98"",
|
|
""path"": ""<Keyboard>/downArrow"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""Down"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": false
|
|
},
|
|
{
|
|
""name"": """",
|
|
""id"": ""01e9d24e-7415-451d-ba2d-59532111112d"",
|
|
""path"": ""<Keyboard>/upArrow"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""Up"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": false
|
|
}
|
|
]
|
|
},
|
|
{
|
|
""name"": ""Game"",
|
|
""id"": ""34e27e63-e254-48d1-938a-1908b0e4e387"",
|
|
""actions"": [
|
|
{
|
|
""name"": ""Tap0"",
|
|
""type"": ""Button"",
|
|
""id"": ""d9a45505-fce6-4337-a13a-a188973fee71"",
|
|
""expectedControlType"": """",
|
|
""processors"": """",
|
|
""interactions"": """",
|
|
""initialStateCheck"": false
|
|
},
|
|
{
|
|
""name"": ""Tap1"",
|
|
""type"": ""Button"",
|
|
""id"": ""7b1cf3f3-a76f-40e9-b0b9-5a1168533ea0"",
|
|
""expectedControlType"": """",
|
|
""processors"": """",
|
|
""interactions"": """",
|
|
""initialStateCheck"": false
|
|
},
|
|
{
|
|
""name"": ""Tap2"",
|
|
""type"": ""Button"",
|
|
""id"": ""17a50d54-b864-4fd1-81b8-94abbc782db2"",
|
|
""expectedControlType"": """",
|
|
""processors"": """",
|
|
""interactions"": """",
|
|
""initialStateCheck"": false
|
|
},
|
|
{
|
|
""name"": ""Tap3"",
|
|
""type"": ""Button"",
|
|
""id"": ""ff612599-a717-4171-a052-8d4c3ce235ab"",
|
|
""expectedControlType"": """",
|
|
""processors"": """",
|
|
""interactions"": """",
|
|
""initialStateCheck"": false
|
|
},
|
|
{
|
|
""name"": ""Touch0"",
|
|
""type"": ""PassThrough"",
|
|
""id"": ""e1fd90c5-246e-49c0-8e79-78583b7ad2a0"",
|
|
""expectedControlType"": ""Button"",
|
|
""processors"": """",
|
|
""interactions"": """",
|
|
""initialStateCheck"": false
|
|
},
|
|
{
|
|
""name"": ""Touch1"",
|
|
""type"": ""PassThrough"",
|
|
""id"": ""56b821bf-f0c5-4dd0-890c-b3ea7c8a53c8"",
|
|
""expectedControlType"": ""Button"",
|
|
""processors"": """",
|
|
""interactions"": """",
|
|
""initialStateCheck"": false
|
|
},
|
|
{
|
|
""name"": ""Touch2"",
|
|
""type"": ""PassThrough"",
|
|
""id"": ""f19ec1cf-27a6-4434-9d25-c693056c0e5e"",
|
|
""expectedControlType"": ""Button"",
|
|
""processors"": """",
|
|
""interactions"": """",
|
|
""initialStateCheck"": false
|
|
},
|
|
{
|
|
""name"": ""Touch3"",
|
|
""type"": ""PassThrough"",
|
|
""id"": ""c278780f-1f4f-428d-baa6-01b91fcdbd4f"",
|
|
""expectedControlType"": ""Button"",
|
|
""processors"": """",
|
|
""interactions"": """",
|
|
""initialStateCheck"": false
|
|
},
|
|
{
|
|
""name"": ""Swipe0"",
|
|
""type"": ""PassThrough"",
|
|
""id"": ""2892cd2c-e15e-40ee-96ef-f454e72ea432"",
|
|
""expectedControlType"": ""Button"",
|
|
""processors"": """",
|
|
""interactions"": """",
|
|
""initialStateCheck"": false
|
|
},
|
|
{
|
|
""name"": ""Swipe1"",
|
|
""type"": ""PassThrough"",
|
|
""id"": ""9c989a19-a9bf-4d1a-87e5-b0390996ff8f"",
|
|
""expectedControlType"": ""Button"",
|
|
""processors"": """",
|
|
""interactions"": """",
|
|
""initialStateCheck"": false
|
|
}
|
|
],
|
|
""bindings"": [
|
|
{
|
|
""name"": """",
|
|
""id"": ""d93b6f05-916f-4c3b-9579-8edcbeea7cac"",
|
|
""path"": ""<Keyboard>/d"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""Tap0"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": false
|
|
},
|
|
{
|
|
""name"": """",
|
|
""id"": ""909e8506-2eb3-4909-ba01-17faef83647c"",
|
|
""path"": ""<Keyboard>/f"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""Tap1"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": false
|
|
},
|
|
{
|
|
""name"": """",
|
|
""id"": ""7d3cb5dc-e61e-4db8-a4f2-70dc99817e40"",
|
|
""path"": ""<Keyboard>/j"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""Tap2"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": false
|
|
},
|
|
{
|
|
""name"": """",
|
|
""id"": ""e99763fa-19aa-4296-ba00-3c6ab5f6bbb7"",
|
|
""path"": ""<Keyboard>/k"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""Tap3"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": false
|
|
},
|
|
{
|
|
""name"": """",
|
|
""id"": ""b8cd4ed0-5b8a-4af9-b467-b8476d18f723"",
|
|
""path"": ""<Keyboard>/d"",
|
|
""interactions"": ""Hold"",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""Touch0"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": false
|
|
},
|
|
{
|
|
""name"": """",
|
|
""id"": ""54dffe0d-8cb6-45c2-8327-417eca9e64f1"",
|
|
""path"": ""<Keyboard>/f"",
|
|
""interactions"": ""Hold"",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""Touch1"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": false
|
|
},
|
|
{
|
|
""name"": """",
|
|
""id"": ""f3b8470e-8562-42b8-8d53-b90010a8457d"",
|
|
""path"": ""<Keyboard>/j"",
|
|
""interactions"": ""Hold"",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""Touch2"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": false
|
|
},
|
|
{
|
|
""name"": """",
|
|
""id"": ""023f9d05-ddbb-4afd-8562-6e89e3c0c7cf"",
|
|
""path"": ""<Keyboard>/k"",
|
|
""interactions"": ""Hold"",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""Touch3"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": false
|
|
},
|
|
{
|
|
""name"": """",
|
|
""id"": ""a142e84f-0405-46bf-98e4-5a3ee1ad2083"",
|
|
""path"": ""<Keyboard>/space"",
|
|
""interactions"": ""Hold"",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""Swipe0"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": false
|
|
},
|
|
{
|
|
""name"": """",
|
|
""id"": ""f639a210-bcca-4ec9-b89b-5cf5d74b4a20"",
|
|
""path"": ""<Keyboard>/k"",
|
|
""interactions"": ""Hold"",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""Swipe1"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": false
|
|
}
|
|
]
|
|
}
|
|
],
|
|
""controlSchemes"": []
|
|
}");
|
|
// Menu
|
|
m_Menu = asset.FindActionMap("Menu", throwIfNotFound: true);
|
|
m_Menu_Scroll = m_Menu.FindAction("Scroll", throwIfNotFound: true);
|
|
m_Menu_Down = m_Menu.FindAction("Down", throwIfNotFound: true);
|
|
m_Menu_Up = m_Menu.FindAction("Up", throwIfNotFound: true);
|
|
// Game
|
|
m_Game = asset.FindActionMap("Game", throwIfNotFound: true);
|
|
m_Game_Tap0 = m_Game.FindAction("Tap0", throwIfNotFound: true);
|
|
m_Game_Tap1 = m_Game.FindAction("Tap1", throwIfNotFound: true);
|
|
m_Game_Tap2 = m_Game.FindAction("Tap2", throwIfNotFound: true);
|
|
m_Game_Tap3 = m_Game.FindAction("Tap3", throwIfNotFound: true);
|
|
m_Game_Touch0 = m_Game.FindAction("Touch0", throwIfNotFound: true);
|
|
m_Game_Touch1 = m_Game.FindAction("Touch1", throwIfNotFound: true);
|
|
m_Game_Touch2 = m_Game.FindAction("Touch2", throwIfNotFound: true);
|
|
m_Game_Touch3 = m_Game.FindAction("Touch3", throwIfNotFound: true);
|
|
m_Game_Swipe0 = m_Game.FindAction("Swipe0", throwIfNotFound: true);
|
|
m_Game_Swipe1 = m_Game.FindAction("Swipe1", throwIfNotFound: true);
|
|
}
|
|
|
|
~@GameInput()
|
|
{
|
|
UnityEngine.Debug.Assert(!m_Menu.enabled, "This will cause a leak and performance issues, GameInput.Menu.Disable() has not been called.");
|
|
UnityEngine.Debug.Assert(!m_Game.enabled, "This will cause a leak and performance issues, GameInput.Game.Disable() has not been called.");
|
|
}
|
|
|
|
/// <summary>
|
|
/// Destroys this asset and all associated <see cref="InputAction"/> instances.
|
|
/// </summary>
|
|
public void Dispose()
|
|
{
|
|
UnityEngine.Object.Destroy(asset);
|
|
}
|
|
|
|
/// <inheritdoc cref="UnityEngine.InputSystem.InputActionAsset.bindingMask" />
|
|
public InputBinding? bindingMask
|
|
{
|
|
get => asset.bindingMask;
|
|
set => asset.bindingMask = value;
|
|
}
|
|
|
|
/// <inheritdoc cref="UnityEngine.InputSystem.InputActionAsset.devices" />
|
|
public ReadOnlyArray<InputDevice>? devices
|
|
{
|
|
get => asset.devices;
|
|
set => asset.devices = value;
|
|
}
|
|
|
|
/// <inheritdoc cref="UnityEngine.InputSystem.InputActionAsset.controlSchemes" />
|
|
public ReadOnlyArray<InputControlScheme> controlSchemes => asset.controlSchemes;
|
|
|
|
/// <inheritdoc cref="UnityEngine.InputSystem.InputActionAsset.Contains(InputAction)" />
|
|
public bool Contains(InputAction action)
|
|
{
|
|
return asset.Contains(action);
|
|
}
|
|
|
|
/// <inheritdoc cref="UnityEngine.InputSystem.InputActionAsset.GetEnumerator()" />
|
|
public IEnumerator<InputAction> GetEnumerator()
|
|
{
|
|
return asset.GetEnumerator();
|
|
}
|
|
|
|
/// <inheritdoc cref="IEnumerable.GetEnumerator()" />
|
|
IEnumerator IEnumerable.GetEnumerator()
|
|
{
|
|
return GetEnumerator();
|
|
}
|
|
|
|
/// <inheritdoc cref="UnityEngine.InputSystem.InputActionAsset.Enable()" />
|
|
public void Enable()
|
|
{
|
|
asset.Enable();
|
|
}
|
|
|
|
/// <inheritdoc cref="UnityEngine.InputSystem.InputActionAsset.Disable()" />
|
|
public void Disable()
|
|
{
|
|
asset.Disable();
|
|
}
|
|
|
|
/// <inheritdoc cref="UnityEngine.InputSystem.InputActionAsset.bindings" />
|
|
public IEnumerable<InputBinding> bindings => asset.bindings;
|
|
|
|
/// <inheritdoc cref="UnityEngine.InputSystem.InputActionAsset.FindAction(string, bool)" />
|
|
public InputAction FindAction(string actionNameOrId, bool throwIfNotFound = false)
|
|
{
|
|
return asset.FindAction(actionNameOrId, throwIfNotFound);
|
|
}
|
|
|
|
/// <inheritdoc cref="UnityEngine.InputSystem.InputActionAsset.FindBinding(InputBinding, out InputAction)" />
|
|
public int FindBinding(InputBinding bindingMask, out InputAction action)
|
|
{
|
|
return asset.FindBinding(bindingMask, out action);
|
|
}
|
|
|
|
// Menu
|
|
private readonly InputActionMap m_Menu;
|
|
private List<IMenuActions> m_MenuActionsCallbackInterfaces = new List<IMenuActions>();
|
|
private readonly InputAction m_Menu_Scroll;
|
|
private readonly InputAction m_Menu_Down;
|
|
private readonly InputAction m_Menu_Up;
|
|
/// <summary>
|
|
/// Provides access to input actions defined in input action map "Menu".
|
|
/// </summary>
|
|
public struct MenuActions
|
|
{
|
|
private @GameInput m_Wrapper;
|
|
|
|
/// <summary>
|
|
/// Construct a new instance of the input action map wrapper class.
|
|
/// </summary>
|
|
public MenuActions(@GameInput wrapper) { m_Wrapper = wrapper; }
|
|
/// <summary>
|
|
/// Provides access to the underlying input action "Menu/Scroll".
|
|
/// </summary>
|
|
public InputAction @Scroll => m_Wrapper.m_Menu_Scroll;
|
|
/// <summary>
|
|
/// Provides access to the underlying input action "Menu/Down".
|
|
/// </summary>
|
|
public InputAction @Down => m_Wrapper.m_Menu_Down;
|
|
/// <summary>
|
|
/// Provides access to the underlying input action "Menu/Up".
|
|
/// </summary>
|
|
public InputAction @Up => m_Wrapper.m_Menu_Up;
|
|
/// <summary>
|
|
/// Provides access to the underlying input action map instance.
|
|
/// </summary>
|
|
public InputActionMap Get() { return m_Wrapper.m_Menu; }
|
|
/// <inheritdoc cref="UnityEngine.InputSystem.InputActionMap.Enable()" />
|
|
public void Enable() { Get().Enable(); }
|
|
/// <inheritdoc cref="UnityEngine.InputSystem.InputActionMap.Disable()" />
|
|
public void Disable() { Get().Disable(); }
|
|
/// <inheritdoc cref="UnityEngine.InputSystem.InputActionMap.enabled" />
|
|
public bool enabled => Get().enabled;
|
|
/// <summary>
|
|
/// Implicitly converts an <see ref="MenuActions" /> to an <see ref="InputActionMap" /> instance.
|
|
/// </summary>
|
|
public static implicit operator InputActionMap(MenuActions set) { return set.Get(); }
|
|
/// <summary>
|
|
/// 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.
|
|
/// </summary>
|
|
/// <param name="instance">Callback instance.</param>
|
|
/// <remarks>
|
|
/// If <paramref name="instance" /> is <c>null</c> or <paramref name="instance"/> have already been added this method does nothing.
|
|
/// </remarks>
|
|
/// <seealso cref="MenuActions" />
|
|
public void AddCallbacks(IMenuActions instance)
|
|
{
|
|
if (instance == null || m_Wrapper.m_MenuActionsCallbackInterfaces.Contains(instance)) return;
|
|
m_Wrapper.m_MenuActionsCallbackInterfaces.Add(instance);
|
|
@Scroll.started += instance.OnScroll;
|
|
@Scroll.performed += instance.OnScroll;
|
|
@Scroll.canceled += instance.OnScroll;
|
|
@Down.started += instance.OnDown;
|
|
@Down.performed += instance.OnDown;
|
|
@Down.canceled += instance.OnDown;
|
|
@Up.started += instance.OnUp;
|
|
@Up.performed += instance.OnUp;
|
|
@Up.canceled += instance.OnUp;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 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.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Calling this method when <paramref name="instance" /> have not previously been registered has no side-effects.
|
|
/// </remarks>
|
|
/// <seealso cref="MenuActions" />
|
|
private void UnregisterCallbacks(IMenuActions instance)
|
|
{
|
|
@Scroll.started -= instance.OnScroll;
|
|
@Scroll.performed -= instance.OnScroll;
|
|
@Scroll.canceled -= instance.OnScroll;
|
|
@Down.started -= instance.OnDown;
|
|
@Down.performed -= instance.OnDown;
|
|
@Down.canceled -= instance.OnDown;
|
|
@Up.started -= instance.OnUp;
|
|
@Up.performed -= instance.OnUp;
|
|
@Up.canceled -= instance.OnUp;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Unregisters <param cref="instance" /> and unregisters all input action callbacks via <see cref="MenuActions.UnregisterCallbacks(IMenuActions)" />.
|
|
/// </summary>
|
|
/// <seealso cref="MenuActions.UnregisterCallbacks(IMenuActions)" />
|
|
public void RemoveCallbacks(IMenuActions instance)
|
|
{
|
|
if (m_Wrapper.m_MenuActionsCallbackInterfaces.Remove(instance))
|
|
UnregisterCallbacks(instance);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Replaces all existing callback instances and previously registered input action callbacks associated with them with callbacks provided via <param cref="instance" />.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// If <paramref name="instance" /> is <c>null</c>, calling this method will only unregister all existing callbacks but not register any new callbacks.
|
|
/// </remarks>
|
|
/// <seealso cref="MenuActions.AddCallbacks(IMenuActions)" />
|
|
/// <seealso cref="MenuActions.RemoveCallbacks(IMenuActions)" />
|
|
/// <seealso cref="MenuActions.UnregisterCallbacks(IMenuActions)" />
|
|
public void SetCallbacks(IMenuActions instance)
|
|
{
|
|
foreach (var item in m_Wrapper.m_MenuActionsCallbackInterfaces)
|
|
UnregisterCallbacks(item);
|
|
m_Wrapper.m_MenuActionsCallbackInterfaces.Clear();
|
|
AddCallbacks(instance);
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// Provides a new <see cref="MenuActions" /> instance referencing this action map.
|
|
/// </summary>
|
|
public MenuActions @Menu => new MenuActions(this);
|
|
|
|
// Game
|
|
private readonly InputActionMap m_Game;
|
|
private List<IGameActions> m_GameActionsCallbackInterfaces = new List<IGameActions>();
|
|
private readonly InputAction m_Game_Tap0;
|
|
private readonly InputAction m_Game_Tap1;
|
|
private readonly InputAction m_Game_Tap2;
|
|
private readonly InputAction m_Game_Tap3;
|
|
private readonly InputAction m_Game_Touch0;
|
|
private readonly InputAction m_Game_Touch1;
|
|
private readonly InputAction m_Game_Touch2;
|
|
private readonly InputAction m_Game_Touch3;
|
|
private readonly InputAction m_Game_Swipe0;
|
|
private readonly InputAction m_Game_Swipe1;
|
|
/// <summary>
|
|
/// Provides access to input actions defined in input action map "Game".
|
|
/// </summary>
|
|
public struct GameActions
|
|
{
|
|
private @GameInput m_Wrapper;
|
|
|
|
/// <summary>
|
|
/// Construct a new instance of the input action map wrapper class.
|
|
/// </summary>
|
|
public GameActions(@GameInput wrapper) { m_Wrapper = wrapper; }
|
|
/// <summary>
|
|
/// Provides access to the underlying input action "Game/Tap0".
|
|
/// </summary>
|
|
public InputAction @Tap0 => m_Wrapper.m_Game_Tap0;
|
|
/// <summary>
|
|
/// Provides access to the underlying input action "Game/Tap1".
|
|
/// </summary>
|
|
public InputAction @Tap1 => m_Wrapper.m_Game_Tap1;
|
|
/// <summary>
|
|
/// Provides access to the underlying input action "Game/Tap2".
|
|
/// </summary>
|
|
public InputAction @Tap2 => m_Wrapper.m_Game_Tap2;
|
|
/// <summary>
|
|
/// Provides access to the underlying input action "Game/Tap3".
|
|
/// </summary>
|
|
public InputAction @Tap3 => m_Wrapper.m_Game_Tap3;
|
|
/// <summary>
|
|
/// Provides access to the underlying input action "Game/Touch0".
|
|
/// </summary>
|
|
public InputAction @Touch0 => m_Wrapper.m_Game_Touch0;
|
|
/// <summary>
|
|
/// Provides access to the underlying input action "Game/Touch1".
|
|
/// </summary>
|
|
public InputAction @Touch1 => m_Wrapper.m_Game_Touch1;
|
|
/// <summary>
|
|
/// Provides access to the underlying input action "Game/Touch2".
|
|
/// </summary>
|
|
public InputAction @Touch2 => m_Wrapper.m_Game_Touch2;
|
|
/// <summary>
|
|
/// Provides access to the underlying input action "Game/Touch3".
|
|
/// </summary>
|
|
public InputAction @Touch3 => m_Wrapper.m_Game_Touch3;
|
|
/// <summary>
|
|
/// Provides access to the underlying input action "Game/Swipe0".
|
|
/// </summary>
|
|
public InputAction @Swipe0 => m_Wrapper.m_Game_Swipe0;
|
|
/// <summary>
|
|
/// Provides access to the underlying input action "Game/Swipe1".
|
|
/// </summary>
|
|
public InputAction @Swipe1 => m_Wrapper.m_Game_Swipe1;
|
|
/// <summary>
|
|
/// Provides access to the underlying input action map instance.
|
|
/// </summary>
|
|
public InputActionMap Get() { return m_Wrapper.m_Game; }
|
|
/// <inheritdoc cref="UnityEngine.InputSystem.InputActionMap.Enable()" />
|
|
public void Enable() { Get().Enable(); }
|
|
/// <inheritdoc cref="UnityEngine.InputSystem.InputActionMap.Disable()" />
|
|
public void Disable() { Get().Disable(); }
|
|
/// <inheritdoc cref="UnityEngine.InputSystem.InputActionMap.enabled" />
|
|
public bool enabled => Get().enabled;
|
|
/// <summary>
|
|
/// Implicitly converts an <see ref="GameActions" /> to an <see ref="InputActionMap" /> instance.
|
|
/// </summary>
|
|
public static implicit operator InputActionMap(GameActions set) { return set.Get(); }
|
|
/// <summary>
|
|
/// 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.
|
|
/// </summary>
|
|
/// <param name="instance">Callback instance.</param>
|
|
/// <remarks>
|
|
/// If <paramref name="instance" /> is <c>null</c> or <paramref name="instance"/> have already been added this method does nothing.
|
|
/// </remarks>
|
|
/// <seealso cref="GameActions" />
|
|
public void AddCallbacks(IGameActions instance)
|
|
{
|
|
if (instance == null || m_Wrapper.m_GameActionsCallbackInterfaces.Contains(instance)) return;
|
|
m_Wrapper.m_GameActionsCallbackInterfaces.Add(instance);
|
|
@Tap0.started += instance.OnTap0;
|
|
@Tap0.performed += instance.OnTap0;
|
|
@Tap0.canceled += instance.OnTap0;
|
|
@Tap1.started += instance.OnTap1;
|
|
@Tap1.performed += instance.OnTap1;
|
|
@Tap1.canceled += instance.OnTap1;
|
|
@Tap2.started += instance.OnTap2;
|
|
@Tap2.performed += instance.OnTap2;
|
|
@Tap2.canceled += instance.OnTap2;
|
|
@Tap3.started += instance.OnTap3;
|
|
@Tap3.performed += instance.OnTap3;
|
|
@Tap3.canceled += instance.OnTap3;
|
|
@Touch0.started += instance.OnTouch0;
|
|
@Touch0.performed += instance.OnTouch0;
|
|
@Touch0.canceled += instance.OnTouch0;
|
|
@Touch1.started += instance.OnTouch1;
|
|
@Touch1.performed += instance.OnTouch1;
|
|
@Touch1.canceled += instance.OnTouch1;
|
|
@Touch2.started += instance.OnTouch2;
|
|
@Touch2.performed += instance.OnTouch2;
|
|
@Touch2.canceled += instance.OnTouch2;
|
|
@Touch3.started += instance.OnTouch3;
|
|
@Touch3.performed += instance.OnTouch3;
|
|
@Touch3.canceled += instance.OnTouch3;
|
|
@Swipe0.started += instance.OnSwipe0;
|
|
@Swipe0.performed += instance.OnSwipe0;
|
|
@Swipe0.canceled += instance.OnSwipe0;
|
|
@Swipe1.started += instance.OnSwipe1;
|
|
@Swipe1.performed += instance.OnSwipe1;
|
|
@Swipe1.canceled += instance.OnSwipe1;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 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.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// Calling this method when <paramref name="instance" /> have not previously been registered has no side-effects.
|
|
/// </remarks>
|
|
/// <seealso cref="GameActions" />
|
|
private void UnregisterCallbacks(IGameActions instance)
|
|
{
|
|
@Tap0.started -= instance.OnTap0;
|
|
@Tap0.performed -= instance.OnTap0;
|
|
@Tap0.canceled -= instance.OnTap0;
|
|
@Tap1.started -= instance.OnTap1;
|
|
@Tap1.performed -= instance.OnTap1;
|
|
@Tap1.canceled -= instance.OnTap1;
|
|
@Tap2.started -= instance.OnTap2;
|
|
@Tap2.performed -= instance.OnTap2;
|
|
@Tap2.canceled -= instance.OnTap2;
|
|
@Tap3.started -= instance.OnTap3;
|
|
@Tap3.performed -= instance.OnTap3;
|
|
@Tap3.canceled -= instance.OnTap3;
|
|
@Touch0.started -= instance.OnTouch0;
|
|
@Touch0.performed -= instance.OnTouch0;
|
|
@Touch0.canceled -= instance.OnTouch0;
|
|
@Touch1.started -= instance.OnTouch1;
|
|
@Touch1.performed -= instance.OnTouch1;
|
|
@Touch1.canceled -= instance.OnTouch1;
|
|
@Touch2.started -= instance.OnTouch2;
|
|
@Touch2.performed -= instance.OnTouch2;
|
|
@Touch2.canceled -= instance.OnTouch2;
|
|
@Touch3.started -= instance.OnTouch3;
|
|
@Touch3.performed -= instance.OnTouch3;
|
|
@Touch3.canceled -= instance.OnTouch3;
|
|
@Swipe0.started -= instance.OnSwipe0;
|
|
@Swipe0.performed -= instance.OnSwipe0;
|
|
@Swipe0.canceled -= instance.OnSwipe0;
|
|
@Swipe1.started -= instance.OnSwipe1;
|
|
@Swipe1.performed -= instance.OnSwipe1;
|
|
@Swipe1.canceled -= instance.OnSwipe1;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Unregisters <param cref="instance" /> and unregisters all input action callbacks via <see cref="GameActions.UnregisterCallbacks(IGameActions)" />.
|
|
/// </summary>
|
|
/// <seealso cref="GameActions.UnregisterCallbacks(IGameActions)" />
|
|
public void RemoveCallbacks(IGameActions instance)
|
|
{
|
|
if (m_Wrapper.m_GameActionsCallbackInterfaces.Remove(instance))
|
|
UnregisterCallbacks(instance);
|
|
}
|
|
|
|
/// <summary>
|
|
/// Replaces all existing callback instances and previously registered input action callbacks associated with them with callbacks provided via <param cref="instance" />.
|
|
/// </summary>
|
|
/// <remarks>
|
|
/// If <paramref name="instance" /> is <c>null</c>, calling this method will only unregister all existing callbacks but not register any new callbacks.
|
|
/// </remarks>
|
|
/// <seealso cref="GameActions.AddCallbacks(IGameActions)" />
|
|
/// <seealso cref="GameActions.RemoveCallbacks(IGameActions)" />
|
|
/// <seealso cref="GameActions.UnregisterCallbacks(IGameActions)" />
|
|
public void SetCallbacks(IGameActions instance)
|
|
{
|
|
foreach (var item in m_Wrapper.m_GameActionsCallbackInterfaces)
|
|
UnregisterCallbacks(item);
|
|
m_Wrapper.m_GameActionsCallbackInterfaces.Clear();
|
|
AddCallbacks(instance);
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// Provides a new <see cref="GameActions" /> instance referencing this action map.
|
|
/// </summary>
|
|
public GameActions @Game => new GameActions(this);
|
|
/// <summary>
|
|
/// Interface to implement callback methods for all input action callbacks associated with input actions defined by "Menu" which allows adding and removing callbacks.
|
|
/// </summary>
|
|
/// <seealso cref="MenuActions.AddCallbacks(IMenuActions)" />
|
|
/// <seealso cref="MenuActions.RemoveCallbacks(IMenuActions)" />
|
|
public interface IMenuActions
|
|
{
|
|
/// <summary>
|
|
/// Method invoked when associated input action "Scroll" is either <see cref="UnityEngine.InputSystem.InputAction.started" />, <see cref="UnityEngine.InputSystem.InputAction.performed" /> or <see cref="UnityEngine.InputSystem.InputAction.canceled" />.
|
|
/// </summary>
|
|
/// <seealso cref="UnityEngine.InputSystem.InputAction.started" />
|
|
/// <seealso cref="UnityEngine.InputSystem.InputAction.performed" />
|
|
/// <seealso cref="UnityEngine.InputSystem.InputAction.canceled" />
|
|
void OnScroll(InputAction.CallbackContext context);
|
|
/// <summary>
|
|
/// Method invoked when associated input action "Down" is either <see cref="UnityEngine.InputSystem.InputAction.started" />, <see cref="UnityEngine.InputSystem.InputAction.performed" /> or <see cref="UnityEngine.InputSystem.InputAction.canceled" />.
|
|
/// </summary>
|
|
/// <seealso cref="UnityEngine.InputSystem.InputAction.started" />
|
|
/// <seealso cref="UnityEngine.InputSystem.InputAction.performed" />
|
|
/// <seealso cref="UnityEngine.InputSystem.InputAction.canceled" />
|
|
void OnDown(InputAction.CallbackContext context);
|
|
/// <summary>
|
|
/// Method invoked when associated input action "Up" is either <see cref="UnityEngine.InputSystem.InputAction.started" />, <see cref="UnityEngine.InputSystem.InputAction.performed" /> or <see cref="UnityEngine.InputSystem.InputAction.canceled" />.
|
|
/// </summary>
|
|
/// <seealso cref="UnityEngine.InputSystem.InputAction.started" />
|
|
/// <seealso cref="UnityEngine.InputSystem.InputAction.performed" />
|
|
/// <seealso cref="UnityEngine.InputSystem.InputAction.canceled" />
|
|
void OnUp(InputAction.CallbackContext context);
|
|
}
|
|
/// <summary>
|
|
/// Interface to implement callback methods for all input action callbacks associated with input actions defined by "Game" which allows adding and removing callbacks.
|
|
/// </summary>
|
|
/// <seealso cref="GameActions.AddCallbacks(IGameActions)" />
|
|
/// <seealso cref="GameActions.RemoveCallbacks(IGameActions)" />
|
|
public interface IGameActions
|
|
{
|
|
/// <summary>
|
|
/// Method invoked when associated input action "Tap0" is either <see cref="UnityEngine.InputSystem.InputAction.started" />, <see cref="UnityEngine.InputSystem.InputAction.performed" /> or <see cref="UnityEngine.InputSystem.InputAction.canceled" />.
|
|
/// </summary>
|
|
/// <seealso cref="UnityEngine.InputSystem.InputAction.started" />
|
|
/// <seealso cref="UnityEngine.InputSystem.InputAction.performed" />
|
|
/// <seealso cref="UnityEngine.InputSystem.InputAction.canceled" />
|
|
void OnTap0(InputAction.CallbackContext context);
|
|
/// <summary>
|
|
/// Method invoked when associated input action "Tap1" is either <see cref="UnityEngine.InputSystem.InputAction.started" />, <see cref="UnityEngine.InputSystem.InputAction.performed" /> or <see cref="UnityEngine.InputSystem.InputAction.canceled" />.
|
|
/// </summary>
|
|
/// <seealso cref="UnityEngine.InputSystem.InputAction.started" />
|
|
/// <seealso cref="UnityEngine.InputSystem.InputAction.performed" />
|
|
/// <seealso cref="UnityEngine.InputSystem.InputAction.canceled" />
|
|
void OnTap1(InputAction.CallbackContext context);
|
|
/// <summary>
|
|
/// Method invoked when associated input action "Tap2" is either <see cref="UnityEngine.InputSystem.InputAction.started" />, <see cref="UnityEngine.InputSystem.InputAction.performed" /> or <see cref="UnityEngine.InputSystem.InputAction.canceled" />.
|
|
/// </summary>
|
|
/// <seealso cref="UnityEngine.InputSystem.InputAction.started" />
|
|
/// <seealso cref="UnityEngine.InputSystem.InputAction.performed" />
|
|
/// <seealso cref="UnityEngine.InputSystem.InputAction.canceled" />
|
|
void OnTap2(InputAction.CallbackContext context);
|
|
/// <summary>
|
|
/// Method invoked when associated input action "Tap3" is either <see cref="UnityEngine.InputSystem.InputAction.started" />, <see cref="UnityEngine.InputSystem.InputAction.performed" /> or <see cref="UnityEngine.InputSystem.InputAction.canceled" />.
|
|
/// </summary>
|
|
/// <seealso cref="UnityEngine.InputSystem.InputAction.started" />
|
|
/// <seealso cref="UnityEngine.InputSystem.InputAction.performed" />
|
|
/// <seealso cref="UnityEngine.InputSystem.InputAction.canceled" />
|
|
void OnTap3(InputAction.CallbackContext context);
|
|
/// <summary>
|
|
/// Method invoked when associated input action "Touch0" is either <see cref="UnityEngine.InputSystem.InputAction.started" />, <see cref="UnityEngine.InputSystem.InputAction.performed" /> or <see cref="UnityEngine.InputSystem.InputAction.canceled" />.
|
|
/// </summary>
|
|
/// <seealso cref="UnityEngine.InputSystem.InputAction.started" />
|
|
/// <seealso cref="UnityEngine.InputSystem.InputAction.performed" />
|
|
/// <seealso cref="UnityEngine.InputSystem.InputAction.canceled" />
|
|
void OnTouch0(InputAction.CallbackContext context);
|
|
/// <summary>
|
|
/// Method invoked when associated input action "Touch1" is either <see cref="UnityEngine.InputSystem.InputAction.started" />, <see cref="UnityEngine.InputSystem.InputAction.performed" /> or <see cref="UnityEngine.InputSystem.InputAction.canceled" />.
|
|
/// </summary>
|
|
/// <seealso cref="UnityEngine.InputSystem.InputAction.started" />
|
|
/// <seealso cref="UnityEngine.InputSystem.InputAction.performed" />
|
|
/// <seealso cref="UnityEngine.InputSystem.InputAction.canceled" />
|
|
void OnTouch1(InputAction.CallbackContext context);
|
|
/// <summary>
|
|
/// Method invoked when associated input action "Touch2" is either <see cref="UnityEngine.InputSystem.InputAction.started" />, <see cref="UnityEngine.InputSystem.InputAction.performed" /> or <see cref="UnityEngine.InputSystem.InputAction.canceled" />.
|
|
/// </summary>
|
|
/// <seealso cref="UnityEngine.InputSystem.InputAction.started" />
|
|
/// <seealso cref="UnityEngine.InputSystem.InputAction.performed" />
|
|
/// <seealso cref="UnityEngine.InputSystem.InputAction.canceled" />
|
|
void OnTouch2(InputAction.CallbackContext context);
|
|
/// <summary>
|
|
/// Method invoked when associated input action "Touch3" is either <see cref="UnityEngine.InputSystem.InputAction.started" />, <see cref="UnityEngine.InputSystem.InputAction.performed" /> or <see cref="UnityEngine.InputSystem.InputAction.canceled" />.
|
|
/// </summary>
|
|
/// <seealso cref="UnityEngine.InputSystem.InputAction.started" />
|
|
/// <seealso cref="UnityEngine.InputSystem.InputAction.performed" />
|
|
/// <seealso cref="UnityEngine.InputSystem.InputAction.canceled" />
|
|
void OnTouch3(InputAction.CallbackContext context);
|
|
/// <summary>
|
|
/// Method invoked when associated input action "Swipe0" is either <see cref="UnityEngine.InputSystem.InputAction.started" />, <see cref="UnityEngine.InputSystem.InputAction.performed" /> or <see cref="UnityEngine.InputSystem.InputAction.canceled" />.
|
|
/// </summary>
|
|
/// <seealso cref="UnityEngine.InputSystem.InputAction.started" />
|
|
/// <seealso cref="UnityEngine.InputSystem.InputAction.performed" />
|
|
/// <seealso cref="UnityEngine.InputSystem.InputAction.canceled" />
|
|
void OnSwipe0(InputAction.CallbackContext context);
|
|
/// <summary>
|
|
/// Method invoked when associated input action "Swipe1" is either <see cref="UnityEngine.InputSystem.InputAction.started" />, <see cref="UnityEngine.InputSystem.InputAction.performed" /> or <see cref="UnityEngine.InputSystem.InputAction.canceled" />.
|
|
/// </summary>
|
|
/// <seealso cref="UnityEngine.InputSystem.InputAction.started" />
|
|
/// <seealso cref="UnityEngine.InputSystem.InputAction.performed" />
|
|
/// <seealso cref="UnityEngine.InputSystem.InputAction.canceled" />
|
|
void OnSwipe1(InputAction.CallbackContext context);
|
|
}
|
|
}
|