242 lines
8.4 KiB
C#
242 lines
8.4 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"": """",
|
|
""initialStateCheck"": false
|
|
}
|
|
],
|
|
""bindings"": [
|
|
{
|
|
""name"": ""WASD"",
|
|
""id"": ""0abdf8dd-305d-410a-9788-0a0b22384fd7"",
|
|
""path"": ""2DVector(mode=1)"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""Movement"",
|
|
""isComposite"": true,
|
|
""isPartOfComposite"": false
|
|
},
|
|
{
|
|
""name"": ""up"",
|
|
""id"": ""4a50dfb9-46c0-4d52-ba54-1f4886fb77b8"",
|
|
""path"": ""<Keyboard>/w"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""Movement"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": true
|
|
},
|
|
{
|
|
""name"": ""down"",
|
|
""id"": ""a50e92c0-3106-47f9-9499-ff34ca987d4c"",
|
|
""path"": ""<Keyboard>/s"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""Movement"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": true
|
|
},
|
|
{
|
|
""name"": ""left"",
|
|
""id"": ""89e61e01-d935-4391-a515-c7f7aac8a744"",
|
|
""path"": ""<Keyboard>/a"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""Movement"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": true
|
|
},
|
|
{
|
|
""name"": ""right"",
|
|
""id"": ""3a6ca3be-d76f-4ab1-ae0f-0193d87f36c0"",
|
|
""path"": ""<Keyboard>/d"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""Movement"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": true
|
|
},
|
|
{
|
|
""name"": """",
|
|
""id"": ""f79d7b08-89bf-4b67-bba8-5ccaaea5501d"",
|
|
""path"": ""<Keyboard>/space"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""Jump"",
|
|
""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);
|
|
}
|
|
|
|
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;
|
|
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 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;
|
|
}
|
|
|
|
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;
|
|
}
|
|
|
|
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);
|
|
}
|
|
}
|