您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
469 行
19 KiB
469 行
19 KiB
// GENERATED AUTOMATICALLY FROM 'Assets/Input/InputActions_Player.inputactions'
|
|
|
|
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine.InputSystem;
|
|
using UnityEngine.InputSystem.Utilities;
|
|
|
|
public class @InputActions_Player : IInputActionCollection, IDisposable
|
|
{
|
|
public InputActionAsset asset { get; }
|
|
public @InputActions_Player()
|
|
{
|
|
asset = InputActionAsset.FromJson(@"{
|
|
""name"": ""InputActions_Player"",
|
|
""maps"": [
|
|
{
|
|
""name"": ""Player Controls"",
|
|
""id"": ""cb4067f3-a685-4c86-b9ea-46a6eabfada7"",
|
|
""actions"": [
|
|
{
|
|
""name"": ""Movement"",
|
|
""type"": ""Value"",
|
|
""id"": ""548e32fd-77d1-40e5-8197-32ca56b41bc0"",
|
|
""expectedControlType"": ""Vector2"",
|
|
""processors"": """",
|
|
""interactions"": """"
|
|
},
|
|
{
|
|
""name"": ""Attack"",
|
|
""type"": ""Button"",
|
|
""id"": ""10fecf58-9483-40e0-ae20-15c8d01a4288"",
|
|
""expectedControlType"": """",
|
|
""processors"": """",
|
|
""interactions"": ""Press""
|
|
},
|
|
{
|
|
""name"": ""OpenPauseMenu"",
|
|
""type"": ""Button"",
|
|
""id"": ""a70a208e-b491-4921-b460-a0144030ef2a"",
|
|
""expectedControlType"": ""Button"",
|
|
""processors"": """",
|
|
""interactions"": ""Press""
|
|
},
|
|
{
|
|
""name"": ""SwipePosition"",
|
|
""type"": ""Value"",
|
|
""id"": ""840b80c7-bc6a-4e66-95cd-c42297731b3d"",
|
|
""expectedControlType"": ""Vector2"",
|
|
""processors"": """",
|
|
""interactions"": """"
|
|
},
|
|
{
|
|
""name"": ""SwipeEvent"",
|
|
""type"": ""Value"",
|
|
""id"": ""f69a88db-b2f5-44ea-a16c-0fba04697410"",
|
|
""expectedControlType"": """",
|
|
""processors"": """",
|
|
""interactions"": ""Press(behavior=2)""
|
|
}
|
|
],
|
|
""bindings"": [
|
|
{
|
|
""name"": ""WASD"",
|
|
""id"": ""99258992-afbc-4513-a4ee-24146566e341"",
|
|
""path"": ""2DVector"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""Movement"",
|
|
""isComposite"": true,
|
|
""isPartOfComposite"": false
|
|
},
|
|
{
|
|
""name"": ""up"",
|
|
""id"": ""d57e0987-ea9f-4b18-9042-239931d4c060"",
|
|
""path"": ""<Keyboard>/w"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": ""Keyboard&Mouse"",
|
|
""action"": ""Movement"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": true
|
|
},
|
|
{
|
|
""name"": ""down"",
|
|
""id"": ""75168890-922f-4122-9968-1ecac0f33c28"",
|
|
""path"": ""<Keyboard>/s"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": ""Keyboard&Mouse"",
|
|
""action"": ""Movement"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": true
|
|
},
|
|
{
|
|
""name"": ""left"",
|
|
""id"": ""54b99838-0c45-421e-af38-b1f25b3f6927"",
|
|
""path"": ""<Keyboard>/a"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": ""Keyboard&Mouse"",
|
|
""action"": ""Movement"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": true
|
|
},
|
|
{
|
|
""name"": ""right"",
|
|
""id"": ""77680fb0-0b9d-4a74-97de-9e3149ad6526"",
|
|
""path"": ""<Keyboard>/d"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": ""Keyboard&Mouse"",
|
|
""action"": ""Movement"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": true
|
|
},
|
|
{
|
|
""name"": """",
|
|
""id"": ""df04a4e1-fc36-4ebd-b050-536736220da7"",
|
|
""path"": ""<Gamepad>/leftStick"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": ""Gamepad"",
|
|
""action"": ""Movement"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": false
|
|
},
|
|
{
|
|
""name"": """",
|
|
""id"": ""42716e15-291c-4c71-8ded-0d03279959df"",
|
|
""path"": ""<Keyboard>/m"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": ""Keyboard&Mouse"",
|
|
""action"": ""OpenPauseMenu"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": false
|
|
},
|
|
{
|
|
""name"": """",
|
|
""id"": ""7e04bd42-932a-47a3-8864-5ff3db25c21b"",
|
|
""path"": ""<Gamepad>/start"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": ""Gamepad"",
|
|
""action"": ""OpenPauseMenu"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": false
|
|
},
|
|
{
|
|
""name"": """",
|
|
""id"": ""b12426a0-38ab-4d90-95e0-6840fcd30db6"",
|
|
""path"": ""<Keyboard>/e"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""Attack"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": false
|
|
},
|
|
{
|
|
""name"": """",
|
|
""id"": ""3e6d6425-a990-4434-b58d-57464db363d4"",
|
|
""path"": ""<Gamepad>/buttonSouth"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""Attack"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": false
|
|
},
|
|
{
|
|
""name"": """",
|
|
""id"": ""67874717-4feb-488c-9042-8fbd28e61a67"",
|
|
""path"": ""<Pointer>/position"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": ""Keyboard&Mouse;Touchscreen"",
|
|
""action"": ""SwipePosition"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": false
|
|
},
|
|
{
|
|
""name"": """",
|
|
""id"": ""4fa2fc10-e314-475c-b919-42646b691646"",
|
|
""path"": ""<Pointer>/press"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": ""Keyboard&Mouse;Touchscreen"",
|
|
""action"": ""SwipeEvent"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": false
|
|
}
|
|
]
|
|
},
|
|
{
|
|
""name"": ""Menu Controls"",
|
|
""id"": ""0914fb5b-51f6-4b26-9ed7-a3e72d065118"",
|
|
""actions"": [
|
|
{
|
|
""name"": ""ClosePauseMenu"",
|
|
""type"": ""Button"",
|
|
""id"": ""e773b1f9-ce5b-4fa2-9c1f-d194202c43b7"",
|
|
""expectedControlType"": """",
|
|
""processors"": """",
|
|
""interactions"": ""Press""
|
|
}
|
|
],
|
|
""bindings"": [
|
|
{
|
|
""name"": """",
|
|
""id"": ""dfac3b8e-d348-4a7a-b60b-14745c641340"",
|
|
""path"": ""<Keyboard>/m"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": ""Keyboard&Mouse"",
|
|
""action"": ""ClosePauseMenu"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": false
|
|
},
|
|
{
|
|
""name"": """",
|
|
""id"": ""f509a7b5-e79a-485e-ba2f-da5431d6fe4c"",
|
|
""path"": ""<Gamepad>/start"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": ""Gamepad"",
|
|
""action"": ""ClosePauseMenu"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": false
|
|
}
|
|
]
|
|
}
|
|
],
|
|
""controlSchemes"": [
|
|
{
|
|
""name"": ""Gamepad"",
|
|
""bindingGroup"": ""Gamepad"",
|
|
""devices"": [
|
|
{
|
|
""devicePath"": ""<Gamepad>"",
|
|
""isOptional"": false,
|
|
""isOR"": false
|
|
}
|
|
]
|
|
},
|
|
{
|
|
""name"": ""Keyboard&Mouse"",
|
|
""bindingGroup"": ""Keyboard&Mouse"",
|
|
""devices"": [
|
|
{
|
|
""devicePath"": ""<Keyboard>"",
|
|
""isOptional"": false,
|
|
""isOR"": false
|
|
},
|
|
{
|
|
""devicePath"": ""<Mouse>"",
|
|
""isOptional"": false,
|
|
""isOR"": false
|
|
}
|
|
]
|
|
},
|
|
{
|
|
""name"": ""Touchscreen"",
|
|
""bindingGroup"": ""Touchscreen"",
|
|
""devices"": [
|
|
{
|
|
""devicePath"": ""<Touchscreen>"",
|
|
""isOptional"": false,
|
|
""isOR"": false
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}");
|
|
// Player Controls
|
|
m_PlayerControls = asset.FindActionMap("Player Controls", throwIfNotFound: true);
|
|
m_PlayerControls_Movement = m_PlayerControls.FindAction("Movement", throwIfNotFound: true);
|
|
m_PlayerControls_Attack = m_PlayerControls.FindAction("Attack", throwIfNotFound: true);
|
|
m_PlayerControls_OpenPauseMenu = m_PlayerControls.FindAction("OpenPauseMenu", throwIfNotFound: true);
|
|
m_PlayerControls_SwipePosition = m_PlayerControls.FindAction("SwipePosition", throwIfNotFound: true);
|
|
m_PlayerControls_SwipeEvent = m_PlayerControls.FindAction("SwipeEvent", throwIfNotFound: true);
|
|
// Menu Controls
|
|
m_MenuControls = asset.FindActionMap("Menu Controls", throwIfNotFound: true);
|
|
m_MenuControls_ClosePauseMenu = m_MenuControls.FindAction("ClosePauseMenu", throwIfNotFound: true);
|
|
}
|
|
|
|
public void Dispose()
|
|
{
|
|
UnityEngine.Object.Destroy(asset);
|
|
}
|
|
|
|
public InputBinding? bindingMask
|
|
{
|
|
get => asset.bindingMask;
|
|
set => asset.bindingMask = value;
|
|
}
|
|
|
|
public ReadOnlyArray<InputDevice>? devices
|
|
{
|
|
get => asset.devices;
|
|
set => asset.devices = value;
|
|
}
|
|
|
|
public ReadOnlyArray<InputControlScheme> controlSchemes => asset.controlSchemes;
|
|
|
|
public bool Contains(InputAction action)
|
|
{
|
|
return asset.Contains(action);
|
|
}
|
|
|
|
public IEnumerator<InputAction> GetEnumerator()
|
|
{
|
|
return asset.GetEnumerator();
|
|
}
|
|
|
|
IEnumerator IEnumerable.GetEnumerator()
|
|
{
|
|
return GetEnumerator();
|
|
}
|
|
|
|
public void Enable()
|
|
{
|
|
asset.Enable();
|
|
}
|
|
|
|
public void Disable()
|
|
{
|
|
asset.Disable();
|
|
}
|
|
|
|
// Player Controls
|
|
private readonly InputActionMap m_PlayerControls;
|
|
private IPlayerControlsActions m_PlayerControlsActionsCallbackInterface;
|
|
private readonly InputAction m_PlayerControls_Movement;
|
|
private readonly InputAction m_PlayerControls_Attack;
|
|
private readonly InputAction m_PlayerControls_OpenPauseMenu;
|
|
private readonly InputAction m_PlayerControls_SwipePosition;
|
|
private readonly InputAction m_PlayerControls_SwipeEvent;
|
|
public struct PlayerControlsActions
|
|
{
|
|
private @InputActions_Player m_Wrapper;
|
|
public PlayerControlsActions(@InputActions_Player wrapper) { m_Wrapper = wrapper; }
|
|
public InputAction @Movement => m_Wrapper.m_PlayerControls_Movement;
|
|
public InputAction @Attack => m_Wrapper.m_PlayerControls_Attack;
|
|
public InputAction @OpenPauseMenu => m_Wrapper.m_PlayerControls_OpenPauseMenu;
|
|
public InputAction @SwipePosition => m_Wrapper.m_PlayerControls_SwipePosition;
|
|
public InputAction @SwipeEvent => m_Wrapper.m_PlayerControls_SwipeEvent;
|
|
public InputActionMap Get() { return m_Wrapper.m_PlayerControls; }
|
|
public void Enable() { Get().Enable(); }
|
|
public void Disable() { Get().Disable(); }
|
|
public bool enabled => Get().enabled;
|
|
public static implicit operator InputActionMap(PlayerControlsActions set) { return set.Get(); }
|
|
public void SetCallbacks(IPlayerControlsActions instance)
|
|
{
|
|
if (m_Wrapper.m_PlayerControlsActionsCallbackInterface != null)
|
|
{
|
|
@Movement.started -= m_Wrapper.m_PlayerControlsActionsCallbackInterface.OnMovement;
|
|
@Movement.performed -= m_Wrapper.m_PlayerControlsActionsCallbackInterface.OnMovement;
|
|
@Movement.canceled -= m_Wrapper.m_PlayerControlsActionsCallbackInterface.OnMovement;
|
|
@Attack.started -= m_Wrapper.m_PlayerControlsActionsCallbackInterface.OnAttack;
|
|
@Attack.performed -= m_Wrapper.m_PlayerControlsActionsCallbackInterface.OnAttack;
|
|
@Attack.canceled -= m_Wrapper.m_PlayerControlsActionsCallbackInterface.OnAttack;
|
|
@OpenPauseMenu.started -= m_Wrapper.m_PlayerControlsActionsCallbackInterface.OnOpenPauseMenu;
|
|
@OpenPauseMenu.performed -= m_Wrapper.m_PlayerControlsActionsCallbackInterface.OnOpenPauseMenu;
|
|
@OpenPauseMenu.canceled -= m_Wrapper.m_PlayerControlsActionsCallbackInterface.OnOpenPauseMenu;
|
|
@SwipePosition.started -= m_Wrapper.m_PlayerControlsActionsCallbackInterface.OnSwipePosition;
|
|
@SwipePosition.performed -= m_Wrapper.m_PlayerControlsActionsCallbackInterface.OnSwipePosition;
|
|
@SwipePosition.canceled -= m_Wrapper.m_PlayerControlsActionsCallbackInterface.OnSwipePosition;
|
|
@SwipeEvent.started -= m_Wrapper.m_PlayerControlsActionsCallbackInterface.OnSwipeEvent;
|
|
@SwipeEvent.performed -= m_Wrapper.m_PlayerControlsActionsCallbackInterface.OnSwipeEvent;
|
|
@SwipeEvent.canceled -= m_Wrapper.m_PlayerControlsActionsCallbackInterface.OnSwipeEvent;
|
|
}
|
|
m_Wrapper.m_PlayerControlsActionsCallbackInterface = instance;
|
|
if (instance != null)
|
|
{
|
|
@Movement.started += instance.OnMovement;
|
|
@Movement.performed += instance.OnMovement;
|
|
@Movement.canceled += instance.OnMovement;
|
|
@Attack.started += instance.OnAttack;
|
|
@Attack.performed += instance.OnAttack;
|
|
@Attack.canceled += instance.OnAttack;
|
|
@OpenPauseMenu.started += instance.OnOpenPauseMenu;
|
|
@OpenPauseMenu.performed += instance.OnOpenPauseMenu;
|
|
@OpenPauseMenu.canceled += instance.OnOpenPauseMenu;
|
|
@SwipePosition.started += instance.OnSwipePosition;
|
|
@SwipePosition.performed += instance.OnSwipePosition;
|
|
@SwipePosition.canceled += instance.OnSwipePosition;
|
|
@SwipeEvent.started += instance.OnSwipeEvent;
|
|
@SwipeEvent.performed += instance.OnSwipeEvent;
|
|
@SwipeEvent.canceled += instance.OnSwipeEvent;
|
|
}
|
|
}
|
|
}
|
|
public PlayerControlsActions @PlayerControls => new PlayerControlsActions(this);
|
|
|
|
// Menu Controls
|
|
private readonly InputActionMap m_MenuControls;
|
|
private IMenuControlsActions m_MenuControlsActionsCallbackInterface;
|
|
private readonly InputAction m_MenuControls_ClosePauseMenu;
|
|
public struct MenuControlsActions
|
|
{
|
|
private @InputActions_Player m_Wrapper;
|
|
public MenuControlsActions(@InputActions_Player wrapper) { m_Wrapper = wrapper; }
|
|
public InputAction @ClosePauseMenu => m_Wrapper.m_MenuControls_ClosePauseMenu;
|
|
public InputActionMap Get() { return m_Wrapper.m_MenuControls; }
|
|
public void Enable() { Get().Enable(); }
|
|
public void Disable() { Get().Disable(); }
|
|
public bool enabled => Get().enabled;
|
|
public static implicit operator InputActionMap(MenuControlsActions set) { return set.Get(); }
|
|
public void SetCallbacks(IMenuControlsActions instance)
|
|
{
|
|
if (m_Wrapper.m_MenuControlsActionsCallbackInterface != null)
|
|
{
|
|
@ClosePauseMenu.started -= m_Wrapper.m_MenuControlsActionsCallbackInterface.OnClosePauseMenu;
|
|
@ClosePauseMenu.performed -= m_Wrapper.m_MenuControlsActionsCallbackInterface.OnClosePauseMenu;
|
|
@ClosePauseMenu.canceled -= m_Wrapper.m_MenuControlsActionsCallbackInterface.OnClosePauseMenu;
|
|
}
|
|
m_Wrapper.m_MenuControlsActionsCallbackInterface = instance;
|
|
if (instance != null)
|
|
{
|
|
@ClosePauseMenu.started += instance.OnClosePauseMenu;
|
|
@ClosePauseMenu.performed += instance.OnClosePauseMenu;
|
|
@ClosePauseMenu.canceled += instance.OnClosePauseMenu;
|
|
}
|
|
}
|
|
}
|
|
public MenuControlsActions @MenuControls => new MenuControlsActions(this);
|
|
private int m_GamepadSchemeIndex = -1;
|
|
public InputControlScheme GamepadScheme
|
|
{
|
|
get
|
|
{
|
|
if (m_GamepadSchemeIndex == -1) m_GamepadSchemeIndex = asset.FindControlSchemeIndex("Gamepad");
|
|
return asset.controlSchemes[m_GamepadSchemeIndex];
|
|
}
|
|
}
|
|
private int m_KeyboardMouseSchemeIndex = -1;
|
|
public InputControlScheme KeyboardMouseScheme
|
|
{
|
|
get
|
|
{
|
|
if (m_KeyboardMouseSchemeIndex == -1) m_KeyboardMouseSchemeIndex = asset.FindControlSchemeIndex("Keyboard&Mouse");
|
|
return asset.controlSchemes[m_KeyboardMouseSchemeIndex];
|
|
}
|
|
}
|
|
private int m_TouchscreenSchemeIndex = -1;
|
|
public InputControlScheme TouchscreenScheme
|
|
{
|
|
get
|
|
{
|
|
if (m_TouchscreenSchemeIndex == -1) m_TouchscreenSchemeIndex = asset.FindControlSchemeIndex("Touchscreen");
|
|
return asset.controlSchemes[m_TouchscreenSchemeIndex];
|
|
}
|
|
}
|
|
public interface IPlayerControlsActions
|
|
{
|
|
void OnMovement(InputAction.CallbackContext context);
|
|
void OnAttack(InputAction.CallbackContext context);
|
|
void OnOpenPauseMenu(InputAction.CallbackContext context);
|
|
void OnSwipePosition(InputAction.CallbackContext context);
|
|
void OnSwipeEvent(InputAction.CallbackContext context);
|
|
}
|
|
public interface IMenuControlsActions
|
|
{
|
|
void OnClosePauseMenu(InputAction.CallbackContext context);
|
|
}
|
|
}
|