You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
432 lines
16 KiB
432 lines
16 KiB
//------------------------------------------------------------------------------
|
|
// <auto-generated>
|
|
// This code was auto-generated by com.unity.inputsystem:InputActionCodeGenerator
|
|
// version 1.11.2
|
|
// from Assets/Scripts/PlayerInput.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;
|
|
|
|
public partial class @PlayerInput: IInputActionCollection2, IDisposable
|
|
{
|
|
public InputActionAsset asset { get; }
|
|
public @PlayerInput()
|
|
{
|
|
asset = InputActionAsset.FromJson(@"{
|
|
""name"": ""PlayerInput"",
|
|
""maps"": [
|
|
{
|
|
""name"": ""Movement"",
|
|
""id"": ""c59c52ca-b1d6-4317-abe1-989eadfb5f7d"",
|
|
""actions"": [
|
|
{
|
|
""name"": ""MoveInput"",
|
|
""type"": ""Value"",
|
|
""id"": ""9fee29ac-d1fd-45ac-9eed-aca251b66a77"",
|
|
""expectedControlType"": ""Vector2"",
|
|
""processors"": """",
|
|
""interactions"": """",
|
|
""initialStateCheck"": true
|
|
},
|
|
{
|
|
""name"": ""StrafeToggle"",
|
|
""type"": ""Button"",
|
|
""id"": ""f4ac4b73-8783-4546-95f9-a16a576b9ab0"",
|
|
""expectedControlType"": """",
|
|
""processors"": """",
|
|
""interactions"": """",
|
|
""initialStateCheck"": false
|
|
},
|
|
{
|
|
""name"": ""Jump"",
|
|
""type"": ""Button"",
|
|
""id"": ""e80d0f2b-5eab-45ab-beb2-659e1d0e5950"",
|
|
""expectedControlType"": """",
|
|
""processors"": """",
|
|
""interactions"": """",
|
|
""initialStateCheck"": false
|
|
}
|
|
],
|
|
""bindings"": [
|
|
{
|
|
""name"": """",
|
|
""id"": ""4185619b-615b-4b11-bae9-0c88cc948ecc"",
|
|
""path"": ""<Gamepad>/leftStick"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": "";Gamepad"",
|
|
""action"": ""MoveInput"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": false
|
|
},
|
|
{
|
|
""name"": ""WASD"",
|
|
""id"": ""1c438110-ad87-4de0-b3ca-7c71fbf03a7c"",
|
|
""path"": ""2DVector"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""MoveInput"",
|
|
""isComposite"": true,
|
|
""isPartOfComposite"": false
|
|
},
|
|
{
|
|
""name"": ""up"",
|
|
""id"": ""22e82d7a-d048-4ee8-a788-2dc3c89f7ce8"",
|
|
""path"": ""<Keyboard>/w"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": "";KeyboardMouse"",
|
|
""action"": ""MoveInput"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": true
|
|
},
|
|
{
|
|
""name"": ""down"",
|
|
""id"": ""e7de3e8c-be7a-46c3-8206-7a1e20a13ea4"",
|
|
""path"": ""<Keyboard>/s"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": "";KeyboardMouse"",
|
|
""action"": ""MoveInput"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": true
|
|
},
|
|
{
|
|
""name"": ""left"",
|
|
""id"": ""1044edb7-2190-4e52-a23d-3646a4f8c4d9"",
|
|
""path"": ""<Keyboard>/a"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": "";KeyboardMouse"",
|
|
""action"": ""MoveInput"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": true
|
|
},
|
|
{
|
|
""name"": ""right"",
|
|
""id"": ""ec482506-0fc6-49db-a2fd-806fe02e566d"",
|
|
""path"": ""<Keyboard>/d"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": "";KeyboardMouse"",
|
|
""action"": ""MoveInput"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": true
|
|
},
|
|
{
|
|
""name"": """",
|
|
""id"": ""e99dcbd6-c0fb-40d9-bcf8-05212c516e2c"",
|
|
""path"": ""<Gamepad>/leftTrigger"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": "";Gamepad"",
|
|
""action"": ""StrafeToggle"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": false
|
|
},
|
|
{
|
|
""name"": """",
|
|
""id"": ""06afad87-3c47-4cf6-9255-8e7b4ec8d824"",
|
|
""path"": ""<Mouse>/rightButton"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": "";KeyboardMouse"",
|
|
""action"": ""StrafeToggle"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": false
|
|
},
|
|
{
|
|
""name"": """",
|
|
""id"": ""eae2cb65-b63b-48ed-9d5a-a2af38cfbc11"",
|
|
""path"": ""<Gamepad>/buttonSouth"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": "";Gamepad"",
|
|
""action"": ""Jump"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": false
|
|
},
|
|
{
|
|
""name"": """",
|
|
""id"": ""6ec07d48-748b-48d1-83f9-d94b3d545c7a"",
|
|
""path"": ""<Keyboard>/space"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": "";KeyboardMouse"",
|
|
""action"": ""Jump"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": false
|
|
}
|
|
]
|
|
},
|
|
{
|
|
""name"": ""Camera"",
|
|
""id"": ""974b31f0-2390-49ae-81e9-a3a1ff0f136b"",
|
|
""actions"": [
|
|
{
|
|
""name"": ""LookInput"",
|
|
""type"": ""Value"",
|
|
""id"": ""04f2f8c7-cd20-466d-8e14-952075fe4100"",
|
|
""expectedControlType"": ""Vector2"",
|
|
""processors"": """",
|
|
""interactions"": """",
|
|
""initialStateCheck"": true
|
|
}
|
|
],
|
|
""bindings"": [
|
|
{
|
|
""name"": """",
|
|
""id"": ""1f28dd67-af74-4694-8890-e807bfef8793"",
|
|
""path"": ""<Gamepad>/rightStick"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": "";Gamepad"",
|
|
""action"": ""LookInput"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": false
|
|
},
|
|
{
|
|
""name"": """",
|
|
""id"": ""863e71dd-932f-420b-8956-7f0240bfc6aa"",
|
|
""path"": ""<Mouse>/delta"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": "";KeyboardMouse"",
|
|
""action"": ""LookInput"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": false
|
|
}
|
|
]
|
|
}
|
|
],
|
|
""controlSchemes"": [
|
|
{
|
|
""name"": ""KeyboardMouse"",
|
|
""bindingGroup"": ""KeyboardMouse"",
|
|
""devices"": []
|
|
},
|
|
{
|
|
""name"": ""Gamepad"",
|
|
""bindingGroup"": ""Gamepad"",
|
|
""devices"": []
|
|
}
|
|
]
|
|
}");
|
|
// Movement
|
|
m_Movement = asset.FindActionMap("Movement", throwIfNotFound: true);
|
|
m_Movement_MoveInput = m_Movement.FindAction("MoveInput", throwIfNotFound: true);
|
|
m_Movement_StrafeToggle = m_Movement.FindAction("StrafeToggle", throwIfNotFound: true);
|
|
m_Movement_Jump = m_Movement.FindAction("Jump", throwIfNotFound: true);
|
|
// Camera
|
|
m_Camera = asset.FindActionMap("Camera", throwIfNotFound: true);
|
|
m_Camera_LookInput = m_Camera.FindAction("LookInput", throwIfNotFound: true);
|
|
}
|
|
|
|
~@PlayerInput()
|
|
{
|
|
UnityEngine.Debug.Assert(!m_Movement.enabled, "This will cause a leak and performance issues, PlayerInput.Movement.Disable() has not been called.");
|
|
UnityEngine.Debug.Assert(!m_Camera.enabled, "This will cause a leak and performance issues, PlayerInput.Camera.Disable() has not been called.");
|
|
}
|
|
|
|
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();
|
|
}
|
|
|
|
public IEnumerable<InputBinding> bindings => asset.bindings;
|
|
|
|
public InputAction FindAction(string actionNameOrId, bool throwIfNotFound = false)
|
|
{
|
|
return asset.FindAction(actionNameOrId, throwIfNotFound);
|
|
}
|
|
|
|
public int FindBinding(InputBinding bindingMask, out InputAction action)
|
|
{
|
|
return asset.FindBinding(bindingMask, out action);
|
|
}
|
|
|
|
// Movement
|
|
private readonly InputActionMap m_Movement;
|
|
private List<IMovementActions> m_MovementActionsCallbackInterfaces = new List<IMovementActions>();
|
|
private readonly InputAction m_Movement_MoveInput;
|
|
private readonly InputAction m_Movement_StrafeToggle;
|
|
private readonly InputAction m_Movement_Jump;
|
|
public struct MovementActions
|
|
{
|
|
private @PlayerInput m_Wrapper;
|
|
public MovementActions(@PlayerInput wrapper) { m_Wrapper = wrapper; }
|
|
public InputAction @MoveInput => m_Wrapper.m_Movement_MoveInput;
|
|
public InputAction @StrafeToggle => m_Wrapper.m_Movement_StrafeToggle;
|
|
public InputAction @Jump => m_Wrapper.m_Movement_Jump;
|
|
public InputActionMap Get() { return m_Wrapper.m_Movement; }
|
|
public void Enable() { Get().Enable(); }
|
|
public void Disable() { Get().Disable(); }
|
|
public bool enabled => Get().enabled;
|
|
public static implicit operator InputActionMap(MovementActions set) { return set.Get(); }
|
|
public void AddCallbacks(IMovementActions instance)
|
|
{
|
|
if (instance == null || m_Wrapper.m_MovementActionsCallbackInterfaces.Contains(instance)) return;
|
|
m_Wrapper.m_MovementActionsCallbackInterfaces.Add(instance);
|
|
@MoveInput.started += instance.OnMoveInput;
|
|
@MoveInput.performed += instance.OnMoveInput;
|
|
@MoveInput.canceled += instance.OnMoveInput;
|
|
@StrafeToggle.started += instance.OnStrafeToggle;
|
|
@StrafeToggle.performed += instance.OnStrafeToggle;
|
|
@StrafeToggle.canceled += instance.OnStrafeToggle;
|
|
@Jump.started += instance.OnJump;
|
|
@Jump.performed += instance.OnJump;
|
|
@Jump.canceled += instance.OnJump;
|
|
}
|
|
|
|
private void UnregisterCallbacks(IMovementActions instance)
|
|
{
|
|
@MoveInput.started -= instance.OnMoveInput;
|
|
@MoveInput.performed -= instance.OnMoveInput;
|
|
@MoveInput.canceled -= instance.OnMoveInput;
|
|
@StrafeToggle.started -= instance.OnStrafeToggle;
|
|
@StrafeToggle.performed -= instance.OnStrafeToggle;
|
|
@StrafeToggle.canceled -= instance.OnStrafeToggle;
|
|
@Jump.started -= instance.OnJump;
|
|
@Jump.performed -= instance.OnJump;
|
|
@Jump.canceled -= instance.OnJump;
|
|
}
|
|
|
|
public void RemoveCallbacks(IMovementActions instance)
|
|
{
|
|
if (m_Wrapper.m_MovementActionsCallbackInterfaces.Remove(instance))
|
|
UnregisterCallbacks(instance);
|
|
}
|
|
|
|
public void SetCallbacks(IMovementActions instance)
|
|
{
|
|
foreach (var item in m_Wrapper.m_MovementActionsCallbackInterfaces)
|
|
UnregisterCallbacks(item);
|
|
m_Wrapper.m_MovementActionsCallbackInterfaces.Clear();
|
|
AddCallbacks(instance);
|
|
}
|
|
}
|
|
public MovementActions @Movement => new MovementActions(this);
|
|
|
|
// Camera
|
|
private readonly InputActionMap m_Camera;
|
|
private List<ICameraActions> m_CameraActionsCallbackInterfaces = new List<ICameraActions>();
|
|
private readonly InputAction m_Camera_LookInput;
|
|
public struct CameraActions
|
|
{
|
|
private @PlayerInput m_Wrapper;
|
|
public CameraActions(@PlayerInput wrapper) { m_Wrapper = wrapper; }
|
|
public InputAction @LookInput => m_Wrapper.m_Camera_LookInput;
|
|
public InputActionMap Get() { return m_Wrapper.m_Camera; }
|
|
public void Enable() { Get().Enable(); }
|
|
public void Disable() { Get().Disable(); }
|
|
public bool enabled => Get().enabled;
|
|
public static implicit operator InputActionMap(CameraActions set) { return set.Get(); }
|
|
public void AddCallbacks(ICameraActions instance)
|
|
{
|
|
if (instance == null || m_Wrapper.m_CameraActionsCallbackInterfaces.Contains(instance)) return;
|
|
m_Wrapper.m_CameraActionsCallbackInterfaces.Add(instance);
|
|
@LookInput.started += instance.OnLookInput;
|
|
@LookInput.performed += instance.OnLookInput;
|
|
@LookInput.canceled += instance.OnLookInput;
|
|
}
|
|
|
|
private void UnregisterCallbacks(ICameraActions instance)
|
|
{
|
|
@LookInput.started -= instance.OnLookInput;
|
|
@LookInput.performed -= instance.OnLookInput;
|
|
@LookInput.canceled -= instance.OnLookInput;
|
|
}
|
|
|
|
public void RemoveCallbacks(ICameraActions instance)
|
|
{
|
|
if (m_Wrapper.m_CameraActionsCallbackInterfaces.Remove(instance))
|
|
UnregisterCallbacks(instance);
|
|
}
|
|
|
|
public void SetCallbacks(ICameraActions instance)
|
|
{
|
|
foreach (var item in m_Wrapper.m_CameraActionsCallbackInterfaces)
|
|
UnregisterCallbacks(item);
|
|
m_Wrapper.m_CameraActionsCallbackInterfaces.Clear();
|
|
AddCallbacks(instance);
|
|
}
|
|
}
|
|
public CameraActions @Camera => new CameraActions(this);
|
|
private int m_KeyboardMouseSchemeIndex = -1;
|
|
public InputControlScheme KeyboardMouseScheme
|
|
{
|
|
get
|
|
{
|
|
if (m_KeyboardMouseSchemeIndex == -1) m_KeyboardMouseSchemeIndex = asset.FindControlSchemeIndex("KeyboardMouse");
|
|
return asset.controlSchemes[m_KeyboardMouseSchemeIndex];
|
|
}
|
|
}
|
|
private int m_GamepadSchemeIndex = -1;
|
|
public InputControlScheme GamepadScheme
|
|
{
|
|
get
|
|
{
|
|
if (m_GamepadSchemeIndex == -1) m_GamepadSchemeIndex = asset.FindControlSchemeIndex("Gamepad");
|
|
return asset.controlSchemes[m_GamepadSchemeIndex];
|
|
}
|
|
}
|
|
public interface IMovementActions
|
|
{
|
|
void OnMoveInput(InputAction.CallbackContext context);
|
|
void OnStrafeToggle(InputAction.CallbackContext context);
|
|
void OnJump(InputAction.CallbackContext context);
|
|
}
|
|
public interface ICameraActions
|
|
{
|
|
void OnLookInput(InputAction.CallbackContext context);
|
|
}
|
|
}
|