andytouch
5 年前
当前提交
8d33cbba
共有 2 个文件被更改,包括 0 次插入 和 397 次删除
-
11InputSystem_Warriors_Project/Assets/Input/InputActions_Player.cs.meta
-
386InputSystem_Warriors_Project/Assets/Input/InputActions_Player.cs
|
|||
fileFormatVersion: 2 |
|||
guid: 3f20056f2c0f84448990e49154167079 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
// 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"" |
|||
} |
|||
], |
|||
""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"", |
|||
""action"": ""Movement"", |
|||
""isComposite"": false, |
|||
""isPartOfComposite"": true |
|||
}, |
|||
{ |
|||
""name"": ""down"", |
|||
""id"": ""75168890-922f-4122-9968-1ecac0f33c28"", |
|||
""path"": ""<Keyboard>/s"", |
|||
""interactions"": """", |
|||
""processors"": """", |
|||
""groups"": ""Keyboard"", |
|||
""action"": ""Movement"", |
|||
""isComposite"": false, |
|||
""isPartOfComposite"": true |
|||
}, |
|||
{ |
|||
""name"": ""left"", |
|||
""id"": ""54b99838-0c45-421e-af38-b1f25b3f6927"", |
|||
""path"": ""<Keyboard>/a"", |
|||
""interactions"": """", |
|||
""processors"": """", |
|||
""groups"": ""Keyboard"", |
|||
""action"": ""Movement"", |
|||
""isComposite"": false, |
|||
""isPartOfComposite"": true |
|||
}, |
|||
{ |
|||
""name"": ""right"", |
|||
""id"": ""77680fb0-0b9d-4a74-97de-9e3149ad6526"", |
|||
""path"": ""<Keyboard>/d"", |
|||
""interactions"": """", |
|||
""processors"": """", |
|||
""groups"": ""Keyboard"", |
|||
""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"", |
|||
""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"": ""3e6d6425-a990-4434-b58d-57464db363d4"", |
|||
""path"": ""<Gamepad>/buttonSouth"", |
|||
""interactions"": """", |
|||
""processors"": """", |
|||
""groups"": ""Gamepad"", |
|||
""action"": ""Attack"", |
|||
""isComposite"": false, |
|||
""isPartOfComposite"": false |
|||
}, |
|||
{ |
|||
""name"": """", |
|||
""id"": ""b12426a0-38ab-4d90-95e0-6840fcd30db6"", |
|||
""path"": ""<Keyboard>/e"", |
|||
""interactions"": """", |
|||
""processors"": """", |
|||
""groups"": ""Keyboard"", |
|||
""action"": ""Attack"", |
|||
""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"", |
|||
""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"", |
|||
""bindingGroup"": ""Keyboard"", |
|||
""devices"": [ |
|||
{ |
|||
""devicePath"": ""<Keyboard>"", |
|||
""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); |
|||
// 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; |
|||
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 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; |
|||
} |
|||
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; |
|||
} |
|||
} |
|||
} |
|||
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_KeyboardSchemeIndex = -1; |
|||
public InputControlScheme KeyboardScheme |
|||
{ |
|||
get |
|||
{ |
|||
if (m_KeyboardSchemeIndex == -1) m_KeyboardSchemeIndex = asset.FindControlSchemeIndex("Keyboard"); |
|||
return asset.controlSchemes[m_KeyboardSchemeIndex]; |
|||
} |
|||
} |
|||
public interface IPlayerControlsActions |
|||
{ |
|||
void OnMovement(InputAction.CallbackContext context); |
|||
void OnAttack(InputAction.CallbackContext context); |
|||
void OnOpenPauseMenu(InputAction.CallbackContext context); |
|||
} |
|||
public interface IMenuControlsActions |
|||
{ |
|||
void OnClosePauseMenu(InputAction.CallbackContext context); |
|||
} |
|||
} |
撰写
预览
正在加载...
取消
保存
Reference in new issue