ImaageQ_Unity_App/Assets/Rendering/Scripts/Input/UserInput.cs
Ignacio Gómez Puga 5847d844a5 Removed TOTU 103
2025-03-04 12:04:52 -06:00

184 lines
6.0 KiB
C#

//------------------------------------------------------------------------------
// <auto-generated>
// This code was auto-generated by com.unity.inputsystem:InputActionCodeGenerator
// version 1.11.0
// from Assets/Rendering/Scripts/Input/UserInput.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 @UserInput: IInputActionCollection2, IDisposable
{
public InputActionAsset asset { get; }
public @UserInput()
{
asset = InputActionAsset.FromJson(@"{
""name"": ""UserInput"",
""maps"": [
{
""name"": ""MobileTouch"",
""id"": ""61b9d527-e568-4d9a-b29c-76c81e318c30"",
""actions"": [
{
""name"": ""Tap"",
""type"": ""Button"",
""id"": ""cc2f4409-7610-4448-8159-a64fcf617dcc"",
""expectedControlType"": """",
""processors"": """",
""interactions"": """",
""initialStateCheck"": false
}
],
""bindings"": [
{
""name"": """",
""id"": ""77adbad9-9a21-48ad-b3ed-9c05bb6b8080"",
""path"": ""<Touchscreen>/primaryTouch/tap"",
""interactions"": ""Tap"",
""processors"": """",
""groups"": """",
""action"": ""Tap"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""d2bc1807-065d-4e50-bb15-4c59d514aee2"",
""path"": ""<Mouse>/leftButton"",
""interactions"": ""Tap"",
""processors"": """",
""groups"": """",
""action"": ""Tap"",
""isComposite"": false,
""isPartOfComposite"": false
}
]
}
],
""controlSchemes"": []
}");
// MobileTouch
m_MobileTouch = asset.FindActionMap("MobileTouch", throwIfNotFound: true);
m_MobileTouch_Tap = m_MobileTouch.FindAction("Tap", throwIfNotFound: true);
}
~@UserInput()
{
UnityEngine.Debug.Assert(!m_MobileTouch.enabled, "This will cause a leak and performance issues, UserInput.MobileTouch.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);
}
// MobileTouch
private readonly InputActionMap m_MobileTouch;
private List<IMobileTouchActions> m_MobileTouchActionsCallbackInterfaces = new List<IMobileTouchActions>();
private readonly InputAction m_MobileTouch_Tap;
public struct MobileTouchActions
{
private @UserInput m_Wrapper;
public MobileTouchActions(@UserInput wrapper) { m_Wrapper = wrapper; }
public InputAction @Tap => m_Wrapper.m_MobileTouch_Tap;
public InputActionMap Get() { return m_Wrapper.m_MobileTouch; }
public void Enable() { Get().Enable(); }
public void Disable() { Get().Disable(); }
public bool enabled => Get().enabled;
public static implicit operator InputActionMap(MobileTouchActions set) { return set.Get(); }
public void AddCallbacks(IMobileTouchActions instance)
{
if (instance == null || m_Wrapper.m_MobileTouchActionsCallbackInterfaces.Contains(instance)) return;
m_Wrapper.m_MobileTouchActionsCallbackInterfaces.Add(instance);
@Tap.started += instance.OnTap;
@Tap.performed += instance.OnTap;
@Tap.canceled += instance.OnTap;
}
private void UnregisterCallbacks(IMobileTouchActions instance)
{
@Tap.started -= instance.OnTap;
@Tap.performed -= instance.OnTap;
@Tap.canceled -= instance.OnTap;
}
public void RemoveCallbacks(IMobileTouchActions instance)
{
if (m_Wrapper.m_MobileTouchActionsCallbackInterfaces.Remove(instance))
UnregisterCallbacks(instance);
}
public void SetCallbacks(IMobileTouchActions instance)
{
foreach (var item in m_Wrapper.m_MobileTouchActionsCallbackInterfaces)
UnregisterCallbacks(item);
m_Wrapper.m_MobileTouchActionsCallbackInterfaces.Clear();
AddCallbacks(instance);
}
}
public MobileTouchActions @MobileTouch => new MobileTouchActions(this);
public interface IMobileTouchActions
{
void OnTap(InputAction.CallbackContext context);
}
}