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.
216 lines
7.2 KiB
216 lines
7.2 KiB
//------------------------------------------------------------------------------ |
|
// <auto-generated> |
|
// This code was auto-generated by com.unity.inputsystem:InputActionCodeGenerator |
|
// version 1.11.2 |
|
// from Assets/Input Settings/Player Controls.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 @PlayerControls: IInputActionCollection2, IDisposable |
|
{ |
|
public InputActionAsset asset { get; } |
|
public @PlayerControls() |
|
{ |
|
asset = InputActionAsset.FromJson(@"{ |
|
""name"": ""Player Controls"", |
|
""maps"": [ |
|
{ |
|
""name"": ""Player"", |
|
""id"": ""075883fa-729b-49cb-b1e5-45d454d783e1"", |
|
""actions"": [ |
|
{ |
|
""name"": ""Move"", |
|
""type"": ""PassThrough"", |
|
""id"": ""20d6c550-6eb3-4134-a6da-2af99cf10cfd"", |
|
""expectedControlType"": ""Vector2"", |
|
""processors"": """", |
|
""interactions"": """", |
|
""initialStateCheck"": false |
|
} |
|
], |
|
""bindings"": [ |
|
{ |
|
""name"": ""2D Vector"", |
|
""id"": ""0f3a8605-bd34-432c-9475-f4a03872c826"", |
|
""path"": ""2DVector"", |
|
""interactions"": """", |
|
""processors"": """", |
|
""groups"": """", |
|
""action"": ""Move"", |
|
""isComposite"": true, |
|
""isPartOfComposite"": false |
|
}, |
|
{ |
|
""name"": ""up"", |
|
""id"": ""c19d7830-3565-4ce7-99f5-09ebd92294ae"", |
|
""path"": ""<Keyboard>/w"", |
|
""interactions"": """", |
|
""processors"": """", |
|
""groups"": """", |
|
""action"": ""Move"", |
|
""isComposite"": false, |
|
""isPartOfComposite"": true |
|
}, |
|
{ |
|
""name"": ""down"", |
|
""id"": ""24065a4e-2f98-4bfa-880e-2cb980deb3db"", |
|
""path"": ""<Keyboard>/s"", |
|
""interactions"": """", |
|
""processors"": """", |
|
""groups"": """", |
|
""action"": ""Move"", |
|
""isComposite"": false, |
|
""isPartOfComposite"": true |
|
}, |
|
{ |
|
""name"": ""left"", |
|
""id"": ""3443cdfe-52c6-49b1-8501-0a835d35abc5"", |
|
""path"": ""<Keyboard>/a"", |
|
""interactions"": """", |
|
""processors"": """", |
|
""groups"": """", |
|
""action"": ""Move"", |
|
""isComposite"": false, |
|
""isPartOfComposite"": true |
|
}, |
|
{ |
|
""name"": ""right"", |
|
""id"": ""1b68aab5-570d-467c-a3be-1027b769ac30"", |
|
""path"": ""<Keyboard>/d"", |
|
""interactions"": """", |
|
""processors"": """", |
|
""groups"": """", |
|
""action"": ""Move"", |
|
""isComposite"": false, |
|
""isPartOfComposite"": true |
|
} |
|
] |
|
} |
|
], |
|
""controlSchemes"": [] |
|
}"); |
|
// Player |
|
m_Player = asset.FindActionMap("Player", throwIfNotFound: true); |
|
m_Player_Move = m_Player.FindAction("Move", throwIfNotFound: true); |
|
} |
|
|
|
~@PlayerControls() |
|
{ |
|
UnityEngine.Debug.Assert(!m_Player.enabled, "This will cause a leak and performance issues, PlayerControls.Player.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); |
|
} |
|
|
|
// Player |
|
private readonly InputActionMap m_Player; |
|
private List<IPlayerActions> m_PlayerActionsCallbackInterfaces = new List<IPlayerActions>(); |
|
private readonly InputAction m_Player_Move; |
|
public struct PlayerActions |
|
{ |
|
private @PlayerControls m_Wrapper; |
|
public PlayerActions(@PlayerControls wrapper) { m_Wrapper = wrapper; } |
|
public InputAction @Move => m_Wrapper.m_Player_Move; |
|
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); |
|
@Move.started += instance.OnMove; |
|
@Move.performed += instance.OnMove; |
|
@Move.canceled += instance.OnMove; |
|
} |
|
|
|
private void UnregisterCallbacks(IPlayerActions instance) |
|
{ |
|
@Move.started -= instance.OnMove; |
|
@Move.performed -= instance.OnMove; |
|
@Move.canceled -= instance.OnMove; |
|
} |
|
|
|
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 OnMove(InputAction.CallbackContext context); |
|
} |
|
}
|
|
|