mirror of
https://github.com/kuhyx/WUT_Computer_Science.git
synced 2026-07-04 19:23:03 +02:00
209 lines
7.4 KiB
C#
209 lines
7.4 KiB
C#
//------------------------------------------------------------------------------
|
|
// <auto-generated>
|
|
// This code was auto-generated by com.unity.inputsystem:InputActionCodeGenerator
|
|
// version 1.3.0
|
|
// from Assets/Input System/BetterInput.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 @BetterInput : IInputActionCollection2, IDisposable
|
|
{
|
|
public InputActionAsset asset { get; }
|
|
public @BetterInput()
|
|
{
|
|
asset = InputActionAsset.FromJson(@"{
|
|
""name"": ""BetterInput"",
|
|
""maps"": [
|
|
{
|
|
""name"": ""Main"",
|
|
""id"": ""4b18db26-1517-44fd-a720-3375a87d3e57"",
|
|
""actions"": [
|
|
{
|
|
""name"": ""MouseLeftClick"",
|
|
""type"": ""Button"",
|
|
""id"": ""8d155000-3a72-43d3-8bfe-93d72a796753"",
|
|
""expectedControlType"": ""Button"",
|
|
""processors"": """",
|
|
""interactions"": """",
|
|
""initialStateCheck"": false
|
|
},
|
|
{
|
|
""name"": ""MousePosition"",
|
|
""type"": ""PassThrough"",
|
|
""id"": ""77dce579-48e8-463c-9642-2c6546293638"",
|
|
""expectedControlType"": ""Vector2"",
|
|
""processors"": """",
|
|
""interactions"": """",
|
|
""initialStateCheck"": false
|
|
}
|
|
],
|
|
""bindings"": [
|
|
{
|
|
""name"": """",
|
|
""id"": ""a5b53ba7-9040-447d-9a40-5d3ef675189c"",
|
|
""path"": ""<Mouse>/leftButton"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": ""Keyboard+Mouse"",
|
|
""action"": ""MouseLeftClick"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": false
|
|
},
|
|
{
|
|
""name"": """",
|
|
""id"": ""67d09b79-2555-46f8-b8f8-d1475b59116a"",
|
|
""path"": ""<Mouse>/position"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": ""Keyboard+Mouse"",
|
|
""action"": ""MousePosition"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": false
|
|
}
|
|
]
|
|
}
|
|
],
|
|
""controlSchemes"": [
|
|
{
|
|
""name"": ""Keyboard+Mouse"",
|
|
""bindingGroup"": ""Keyboard+Mouse"",
|
|
""devices"": [
|
|
{
|
|
""devicePath"": ""<Keyboard>"",
|
|
""isOptional"": false,
|
|
""isOR"": false
|
|
},
|
|
{
|
|
""devicePath"": ""<Mouse>"",
|
|
""isOptional"": false,
|
|
""isOR"": false
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}");
|
|
// Main
|
|
m_Main = asset.FindActionMap("Main", throwIfNotFound: true);
|
|
m_Main_MouseLeftClick = m_Main.FindAction("MouseLeftClick", throwIfNotFound: true);
|
|
m_Main_MousePosition = m_Main.FindAction("MousePosition", 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);
|
|
}
|
|
|
|
// Main
|
|
private readonly InputActionMap m_Main;
|
|
private IMainActions m_MainActionsCallbackInterface;
|
|
private readonly InputAction m_Main_MouseLeftClick;
|
|
private readonly InputAction m_Main_MousePosition;
|
|
public struct MainActions
|
|
{
|
|
private @BetterInput m_Wrapper;
|
|
public MainActions(@BetterInput wrapper) { m_Wrapper = wrapper; }
|
|
public InputAction @MouseLeftClick => m_Wrapper.m_Main_MouseLeftClick;
|
|
public InputAction @MousePosition => m_Wrapper.m_Main_MousePosition;
|
|
public InputActionMap Get() { return m_Wrapper.m_Main; }
|
|
public void Enable() { Get().Enable(); }
|
|
public void Disable() { Get().Disable(); }
|
|
public bool enabled => Get().enabled;
|
|
public static implicit operator InputActionMap(MainActions set) { return set.Get(); }
|
|
public void SetCallbacks(IMainActions instance)
|
|
{
|
|
if (m_Wrapper.m_MainActionsCallbackInterface != null)
|
|
{
|
|
@MouseLeftClick.started -= m_Wrapper.m_MainActionsCallbackInterface.OnMouseLeftClick;
|
|
@MouseLeftClick.performed -= m_Wrapper.m_MainActionsCallbackInterface.OnMouseLeftClick;
|
|
@MouseLeftClick.canceled -= m_Wrapper.m_MainActionsCallbackInterface.OnMouseLeftClick;
|
|
@MousePosition.started -= m_Wrapper.m_MainActionsCallbackInterface.OnMousePosition;
|
|
@MousePosition.performed -= m_Wrapper.m_MainActionsCallbackInterface.OnMousePosition;
|
|
@MousePosition.canceled -= m_Wrapper.m_MainActionsCallbackInterface.OnMousePosition;
|
|
}
|
|
m_Wrapper.m_MainActionsCallbackInterface = instance;
|
|
if (instance != null)
|
|
{
|
|
@MouseLeftClick.started += instance.OnMouseLeftClick;
|
|
@MouseLeftClick.performed += instance.OnMouseLeftClick;
|
|
@MouseLeftClick.canceled += instance.OnMouseLeftClick;
|
|
@MousePosition.started += instance.OnMousePosition;
|
|
@MousePosition.performed += instance.OnMousePosition;
|
|
@MousePosition.canceled += instance.OnMousePosition;
|
|
}
|
|
}
|
|
}
|
|
public MainActions @Main => new MainActions(this);
|
|
private int m_KeyboardMouseSchemeIndex = -1;
|
|
public InputControlScheme KeyboardMouseScheme
|
|
{
|
|
get
|
|
{
|
|
if (m_KeyboardMouseSchemeIndex == -1) m_KeyboardMouseSchemeIndex = asset.FindControlSchemeIndex("Keyboard+Mouse");
|
|
return asset.controlSchemes[m_KeyboardMouseSchemeIndex];
|
|
}
|
|
}
|
|
public interface IMainActions
|
|
{
|
|
void OnMouseLeftClick(InputAction.CallbackContext context);
|
|
void OnMousePosition(InputAction.CallbackContext context);
|
|
}
|
|
}
|