305 lines
11 KiB
C#
305 lines
11 KiB
C#
//------------------------------------------------------------------------------
|
|
// <auto-generated>
|
|
// This code was auto-generated by com.unity.inputsystem:InputActionCodeGenerator
|
|
// version 1.7.0
|
|
// from Assets/Scripts/GameInputs.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 @GameInputs: IInputActionCollection2, IDisposable
|
|
{
|
|
public InputActionAsset asset { get; }
|
|
public @GameInputs()
|
|
{
|
|
asset = InputActionAsset.FromJson(@"{
|
|
""name"": ""GameInputs"",
|
|
""maps"": [
|
|
{
|
|
""name"": ""Player"",
|
|
""id"": ""eb96a956-b7ad-47fd-82f5-b4814e98e6b1"",
|
|
""actions"": [
|
|
{
|
|
""name"": ""Movement"",
|
|
""type"": ""Value"",
|
|
""id"": ""39923aa3-9a9e-4368-8ceb-bebf8ec65530"",
|
|
""expectedControlType"": ""Vector2"",
|
|
""processors"": """",
|
|
""interactions"": """",
|
|
""initialStateCheck"": true
|
|
},
|
|
{
|
|
""name"": ""Jump"",
|
|
""type"": ""Button"",
|
|
""id"": ""436a199c-9091-4d2b-a0e8-afd8675d45f0"",
|
|
""expectedControlType"": ""Button"",
|
|
""processors"": """",
|
|
""interactions"": ""Press"",
|
|
""initialStateCheck"": false
|
|
},
|
|
{
|
|
""name"": ""ChangeCharacter"",
|
|
""type"": ""Button"",
|
|
""id"": ""43304c87-4c03-452f-9c43-3d902adc032e"",
|
|
""expectedControlType"": ""Button"",
|
|
""processors"": """",
|
|
""interactions"": ""Press"",
|
|
""initialStateCheck"": false
|
|
}
|
|
],
|
|
""bindings"": [
|
|
{
|
|
""name"": """",
|
|
""id"": ""f79d7b08-89bf-4b67-bba8-5ccaaea5501d"",
|
|
""path"": ""<Keyboard>/space"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""Jump"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": false
|
|
},
|
|
{
|
|
""name"": """",
|
|
""id"": ""33b2a668-c24d-4232-ac55-ff4e3bb2c69e"",
|
|
""path"": ""<Gamepad>/buttonSouth"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""Jump"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": false
|
|
},
|
|
{
|
|
""name"": ""AD"",
|
|
""id"": ""4c9ec82f-24c0-457d-910e-feb2d226f3a7"",
|
|
""path"": ""2DVector(mode=1)"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""Movement"",
|
|
""isComposite"": true,
|
|
""isPartOfComposite"": false
|
|
},
|
|
{
|
|
""name"": ""up"",
|
|
""id"": ""84119425-90ec-4c8f-b441-53906d174e00"",
|
|
""path"": """",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""Movement"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": true
|
|
},
|
|
{
|
|
""name"": ""down"",
|
|
""id"": ""c1460f5a-ec6b-455b-a677-ebb7c53419fd"",
|
|
""path"": """",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""Movement"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": true
|
|
},
|
|
{
|
|
""name"": ""left"",
|
|
""id"": ""7fc0be6f-4d53-4398-b950-60f5c281ac36"",
|
|
""path"": ""<Keyboard>/a"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""Movement"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": true
|
|
},
|
|
{
|
|
""name"": ""right"",
|
|
""id"": ""17a08552-5a32-446d-b856-078d633a06ae"",
|
|
""path"": ""<Keyboard>/d"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""Movement"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": true
|
|
},
|
|
{
|
|
""name"": """",
|
|
""id"": ""3c53f63f-69a0-4bea-b572-f92acc6c6d98"",
|
|
""path"": ""<Gamepad>/leftStick"",
|
|
""interactions"": """",
|
|
""processors"": ""StickDeadzone"",
|
|
""groups"": """",
|
|
""action"": ""Movement"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": false
|
|
},
|
|
{
|
|
""name"": """",
|
|
""id"": ""733e7020-f05e-4c9e-9868-b4c3b3e8f69a"",
|
|
""path"": ""<Keyboard>/s"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""ChangeCharacter"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": false
|
|
},
|
|
{
|
|
""name"": """",
|
|
""id"": ""ed774249-c11b-4b97-94b3-b1872a92b2f3"",
|
|
""path"": ""<Gamepad>/buttonEast"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""ChangeCharacter"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": false
|
|
}
|
|
]
|
|
}
|
|
],
|
|
""controlSchemes"": []
|
|
}");
|
|
// Player
|
|
m_Player = asset.FindActionMap("Player", throwIfNotFound: true);
|
|
m_Player_Movement = m_Player.FindAction("Movement", throwIfNotFound: true);
|
|
m_Player_Jump = m_Player.FindAction("Jump", throwIfNotFound: true);
|
|
m_Player_ChangeCharacter = m_Player.FindAction("ChangeCharacter", 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);
|
|
}
|
|
|
|
// Player
|
|
private readonly InputActionMap m_Player;
|
|
private List<IPlayerActions> m_PlayerActionsCallbackInterfaces = new List<IPlayerActions>();
|
|
private readonly InputAction m_Player_Movement;
|
|
private readonly InputAction m_Player_Jump;
|
|
private readonly InputAction m_Player_ChangeCharacter;
|
|
public struct PlayerActions
|
|
{
|
|
private @GameInputs m_Wrapper;
|
|
public PlayerActions(@GameInputs wrapper) { m_Wrapper = wrapper; }
|
|
public InputAction @Movement => m_Wrapper.m_Player_Movement;
|
|
public InputAction @Jump => m_Wrapper.m_Player_Jump;
|
|
public InputAction @ChangeCharacter => m_Wrapper.m_Player_ChangeCharacter;
|
|
public InputActionMap Get() { return m_Wrapper.m_Player; }
|
|
public void Enable() { Get().Enable(); }
|
|
public void Disable() { Get().Disable(); }
|
|
public bool enabled => Get().enabled;
|
|
public static implicit operator InputActionMap(PlayerActions set) { return set.Get(); }
|
|
public void AddCallbacks(IPlayerActions instance)
|
|
{
|
|
if (instance == null || m_Wrapper.m_PlayerActionsCallbackInterfaces.Contains(instance)) return;
|
|
m_Wrapper.m_PlayerActionsCallbackInterfaces.Add(instance);
|
|
@Movement.started += instance.OnMovement;
|
|
@Movement.performed += instance.OnMovement;
|
|
@Movement.canceled += instance.OnMovement;
|
|
@Jump.started += instance.OnJump;
|
|
@Jump.performed += instance.OnJump;
|
|
@Jump.canceled += instance.OnJump;
|
|
@ChangeCharacter.started += instance.OnChangeCharacter;
|
|
@ChangeCharacter.performed += instance.OnChangeCharacter;
|
|
@ChangeCharacter.canceled += instance.OnChangeCharacter;
|
|
}
|
|
|
|
private void UnregisterCallbacks(IPlayerActions instance)
|
|
{
|
|
@Movement.started -= instance.OnMovement;
|
|
@Movement.performed -= instance.OnMovement;
|
|
@Movement.canceled -= instance.OnMovement;
|
|
@Jump.started -= instance.OnJump;
|
|
@Jump.performed -= instance.OnJump;
|
|
@Jump.canceled -= instance.OnJump;
|
|
@ChangeCharacter.started -= instance.OnChangeCharacter;
|
|
@ChangeCharacter.performed -= instance.OnChangeCharacter;
|
|
@ChangeCharacter.canceled -= instance.OnChangeCharacter;
|
|
}
|
|
|
|
public void RemoveCallbacks(IPlayerActions instance)
|
|
{
|
|
if (m_Wrapper.m_PlayerActionsCallbackInterfaces.Remove(instance))
|
|
UnregisterCallbacks(instance);
|
|
}
|
|
|
|
public void SetCallbacks(IPlayerActions instance)
|
|
{
|
|
foreach (var item in m_Wrapper.m_PlayerActionsCallbackInterfaces)
|
|
UnregisterCallbacks(item);
|
|
m_Wrapper.m_PlayerActionsCallbackInterfaces.Clear();
|
|
AddCallbacks(instance);
|
|
}
|
|
}
|
|
public PlayerActions @Player => new PlayerActions(this);
|
|
public interface IPlayerActions
|
|
{
|
|
void OnMovement(InputAction.CallbackContext context);
|
|
void OnJump(InputAction.CallbackContext context);
|
|
void OnChangeCharacter(InputAction.CallbackContext context);
|
|
}
|
|
}
|