BGJ-2022.1/Assets/Input/Player.cs

427 lines
18 KiB
C#

//------------------------------------------------------------------------------
// <auto-generated>
// This code was auto-generated by com.unity.inputsystem:InputActionCodeGenerator
// version 1.3.0
// from Assets/Input/Player.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;
namespace Input
{
public partial class @PlayerInput : IInputActionCollection2, IDisposable
{
public InputActionAsset asset { get; }
public @PlayerInput()
{
asset = InputActionAsset.FromJson(@"{
""name"": ""Player"",
""maps"": [
{
""name"": ""PlayerControl"",
""id"": ""6b283d13-6660-4d53-8e92-97340d3e7e40"",
""actions"": [
{
""name"": ""Move"",
""type"": ""Button"",
""id"": ""d609b7bd-de59-47fe-be7c-eab846108ebb"",
""expectedControlType"": ""Button"",
""processors"": """",
""interactions"": """",
""initialStateCheck"": false
},
{
""name"": ""Jump"",
""type"": ""Button"",
""id"": ""838b4154-0282-407c-860e-970ffb1a69dc"",
""expectedControlType"": ""Button"",
""processors"": """",
""interactions"": """",
""initialStateCheck"": false
},
{
""name"": ""Interact"",
""type"": ""Button"",
""id"": ""a0a57f7b-062d-458c-a85a-d6030c412835"",
""expectedControlType"": ""Button"",
""processors"": """",
""interactions"": """",
""initialStateCheck"": false
},
{
""name"": ""Climb"",
""type"": ""Button"",
""id"": ""e2e43254-ce84-4db9-84e9-cad9af922a9f"",
""expectedControlType"": ""Button"",
""processors"": """",
""interactions"": """",
""initialStateCheck"": false
},
{
""name"": ""Pause"",
""type"": ""Button"",
""id"": ""b110facd-253d-41ce-9de7-b589dc48cfc6"",
""expectedControlType"": ""Button"",
""processors"": """",
""interactions"": """",
""initialStateCheck"": false
}
],
""bindings"": [
{
""name"": ""1D Axis Keyboard"",
""id"": ""f1eaf8e5-b149-4905-a8a9-121890ee136c"",
""path"": ""1DAxis"",
""interactions"": """",
""processors"": """",
""groups"": """",
""action"": ""Move"",
""isComposite"": true,
""isPartOfComposite"": false
},
{
""name"": ""negative"",
""id"": ""a9afa3f2-ec1f-430d-a41b-77d221b7d656"",
""path"": ""<Keyboard>/leftArrow"",
""interactions"": """",
""processors"": """",
""groups"": ""KeyBoard"",
""action"": ""Move"",
""isComposite"": false,
""isPartOfComposite"": true
},
{
""name"": ""positive"",
""id"": ""064aa7d7-b08b-4cea-915f-e225e5c62072"",
""path"": ""<Keyboard>/rightArrow"",
""interactions"": """",
""processors"": """",
""groups"": ""KeyBoard"",
""action"": ""Move"",
""isComposite"": false,
""isPartOfComposite"": true
},
{
""name"": ""1D Axis Gamepad"",
""id"": ""93eaa249-8b44-4767-b233-0ed70a500631"",
""path"": ""1DAxis"",
""interactions"": """",
""processors"": """",
""groups"": """",
""action"": ""Move"",
""isComposite"": true,
""isPartOfComposite"": false
},
{
""name"": ""negative"",
""id"": ""084c37a9-d0a1-4ffa-988b-301e97060e91"",
""path"": ""<Gamepad>/leftStick/left"",
""interactions"": """",
""processors"": """",
""groups"": ""Controller"",
""action"": ""Move"",
""isComposite"": false,
""isPartOfComposite"": true
},
{
""name"": ""positive"",
""id"": ""a0c7812a-cdf9-4a02-9394-ea1ea5bd3d37"",
""path"": ""<Gamepad>/leftStick/right"",
""interactions"": """",
""processors"": """",
""groups"": ""Controller"",
""action"": ""Move"",
""isComposite"": false,
""isPartOfComposite"": true
},
{
""name"": """",
""id"": ""7e8fccb6-fdf3-48f1-a967-3ade3adf570a"",
""path"": ""<Keyboard>/space"",
""interactions"": """",
""processors"": """",
""groups"": ""KeyBoard"",
""action"": ""Jump"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""868cbe30-e640-4d8d-b818-a57529b316c8"",
""path"": ""<Gamepad>/buttonSouth"",
""interactions"": """",
""processors"": """",
""groups"": ""Controller"",
""action"": ""Jump"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""4eb9a209-b978-4daf-927a-2f013348d294"",
""path"": ""<Keyboard>/e"",
""interactions"": """",
""processors"": """",
""groups"": ""KeyBoard"",
""action"": ""Interact"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""c2dc0361-1191-4641-97e6-d105f64ee7ff"",
""path"": ""<Gamepad>/buttonEast"",
""interactions"": """",
""processors"": """",
""groups"": ""Controller"",
""action"": ""Interact"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""d690447f-c6c0-4ce5-aca1-c92e65d0ccc6"",
""path"": ""<Gamepad>/leftTrigger"",
""interactions"": """",
""processors"": """",
""groups"": ""Controller"",
""action"": ""Climb"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""010bad3a-3b2d-4a15-aec1-e927c7b749a1"",
""path"": ""<Gamepad>/rightTrigger"",
""interactions"": """",
""processors"": """",
""groups"": ""Controller"",
""action"": ""Climb"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""02b2ecde-c402-4840-9246-2bcd32b085de"",
""path"": ""<Keyboard>/x"",
""interactions"": """",
""processors"": """",
""groups"": ""KeyBoard"",
""action"": ""Climb"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""6a01ec66-e7a4-426a-8ee4-977d456b200c"",
""path"": ""<Gamepad>/start"",
""interactions"": """",
""processors"": """",
""groups"": ""Controller"",
""action"": ""Pause"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""279efb3d-768d-49fd-91f5-c74ebe08c880"",
""path"": ""<Keyboard>/escape"",
""interactions"": """",
""processors"": """",
""groups"": ""KeyBoard"",
""action"": ""Pause"",
""isComposite"": false,
""isPartOfComposite"": false
}
]
}
],
""controlSchemes"": [
{
""name"": ""Controller"",
""bindingGroup"": ""Controller"",
""devices"": [
{
""devicePath"": ""<Gamepad>"",
""isOptional"": false,
""isOR"": false
}
]
},
{
""name"": ""KeyBoard"",
""bindingGroup"": ""KeyBoard"",
""devices"": [
{
""devicePath"": ""<Keyboard>"",
""isOptional"": false,
""isOR"": false
}
]
}
]
}");
// PlayerControl
m_PlayerControl = asset.FindActionMap("PlayerControl", throwIfNotFound: true);
m_PlayerControl_Move = m_PlayerControl.FindAction("Move", throwIfNotFound: true);
m_PlayerControl_Jump = m_PlayerControl.FindAction("Jump", throwIfNotFound: true);
m_PlayerControl_Interact = m_PlayerControl.FindAction("Interact", throwIfNotFound: true);
m_PlayerControl_Climb = m_PlayerControl.FindAction("Climb", throwIfNotFound: true);
m_PlayerControl_Pause = m_PlayerControl.FindAction("Pause", 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();
}
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);
}
// PlayerControl
private readonly InputActionMap m_PlayerControl;
private IPlayerControlActions m_PlayerControlActionsCallbackInterface;
private readonly InputAction m_PlayerControl_Move;
private readonly InputAction m_PlayerControl_Jump;
private readonly InputAction m_PlayerControl_Interact;
private readonly InputAction m_PlayerControl_Climb;
private readonly InputAction m_PlayerControl_Pause;
public struct PlayerControlActions
{
private @PlayerInput m_Wrapper;
public PlayerControlActions(@PlayerInput wrapper) { m_Wrapper = wrapper; }
public InputAction @Move => m_Wrapper.m_PlayerControl_Move;
public InputAction @Jump => m_Wrapper.m_PlayerControl_Jump;
public InputAction @Interact => m_Wrapper.m_PlayerControl_Interact;
public InputAction @Climb => m_Wrapper.m_PlayerControl_Climb;
public InputAction @Pause => m_Wrapper.m_PlayerControl_Pause;
public InputActionMap Get() { return m_Wrapper.m_PlayerControl; }
public void Enable() { Get().Enable(); }
public void Disable() { Get().Disable(); }
public bool enabled => Get().enabled;
public static implicit operator InputActionMap(PlayerControlActions set) { return set.Get(); }
public void SetCallbacks(IPlayerControlActions instance)
{
if (m_Wrapper.m_PlayerControlActionsCallbackInterface != null)
{
@Move.started -= m_Wrapper.m_PlayerControlActionsCallbackInterface.OnMove;
@Move.performed -= m_Wrapper.m_PlayerControlActionsCallbackInterface.OnMove;
@Move.canceled -= m_Wrapper.m_PlayerControlActionsCallbackInterface.OnMove;
@Jump.started -= m_Wrapper.m_PlayerControlActionsCallbackInterface.OnJump;
@Jump.performed -= m_Wrapper.m_PlayerControlActionsCallbackInterface.OnJump;
@Jump.canceled -= m_Wrapper.m_PlayerControlActionsCallbackInterface.OnJump;
@Interact.started -= m_Wrapper.m_PlayerControlActionsCallbackInterface.OnInteract;
@Interact.performed -= m_Wrapper.m_PlayerControlActionsCallbackInterface.OnInteract;
@Interact.canceled -= m_Wrapper.m_PlayerControlActionsCallbackInterface.OnInteract;
@Climb.started -= m_Wrapper.m_PlayerControlActionsCallbackInterface.OnClimb;
@Climb.performed -= m_Wrapper.m_PlayerControlActionsCallbackInterface.OnClimb;
@Climb.canceled -= m_Wrapper.m_PlayerControlActionsCallbackInterface.OnClimb;
@Pause.started -= m_Wrapper.m_PlayerControlActionsCallbackInterface.OnPause;
@Pause.performed -= m_Wrapper.m_PlayerControlActionsCallbackInterface.OnPause;
@Pause.canceled -= m_Wrapper.m_PlayerControlActionsCallbackInterface.OnPause;
}
m_Wrapper.m_PlayerControlActionsCallbackInterface = instance;
if (instance != null)
{
@Move.started += instance.OnMove;
@Move.performed += instance.OnMove;
@Move.canceled += instance.OnMove;
@Jump.started += instance.OnJump;
@Jump.performed += instance.OnJump;
@Jump.canceled += instance.OnJump;
@Interact.started += instance.OnInteract;
@Interact.performed += instance.OnInteract;
@Interact.canceled += instance.OnInteract;
@Climb.started += instance.OnClimb;
@Climb.performed += instance.OnClimb;
@Climb.canceled += instance.OnClimb;
@Pause.started += instance.OnPause;
@Pause.performed += instance.OnPause;
@Pause.canceled += instance.OnPause;
}
}
}
public PlayerControlActions @PlayerControl => new PlayerControlActions(this);
private int m_ControllerSchemeIndex = -1;
public InputControlScheme ControllerScheme
{
get
{
if (m_ControllerSchemeIndex == -1) m_ControllerSchemeIndex = asset.FindControlSchemeIndex("Controller");
return asset.controlSchemes[m_ControllerSchemeIndex];
}
}
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 IPlayerControlActions
{
void OnMove(InputAction.CallbackContext context);
void OnJump(InputAction.CallbackContext context);
void OnInteract(InputAction.CallbackContext context);
void OnClimb(InputAction.CallbackContext context);
void OnPause(InputAction.CallbackContext context);
}
}
}