MayHeCome/Assets/三问c#/CameraInput.cs
2024-12-18 17:55:34 +08:00

313 lines
12 KiB
C#

//------------------------------------------------------------------------------
// <auto-generated>
// This code was auto-generated by com.unity.inputsystem:InputActionCodeGenerator
// version 1.7.0
// from Assets/三问c#/CameraInput.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 @CameraMove: IInputActionCollection2, IDisposable
{
public InputActionAsset asset { get; }
public @CameraMove()
{
asset = InputActionAsset.FromJson(@"{
""name"": ""CameraInput"",
""maps"": [
{
""name"": ""Tree"",
""id"": ""7fd663fe-9845-4b1b-b685-cb9b214e4174"",
""actions"": [
{
""name"": ""LeftClick"",
""type"": ""Value"",
""id"": ""f359a36d-c477-45e7-93f7-a1872aea494b"",
""expectedControlType"": ""Button"",
""processors"": """",
""interactions"": """",
""initialStateCheck"": true
},
{
""name"": ""Move"",
""type"": ""Button"",
""id"": ""af376c0d-e7ed-47f0-939b-5c6d3823c66e"",
""expectedControlType"": ""Button"",
""processors"": """",
""interactions"": """",
""initialStateCheck"": false
},
{
""name"": ""Zoom"",
""type"": ""Value"",
""id"": ""b6a9f27d-8fdf-4cc8-9522-748248e345dc"",
""expectedControlType"": ""Delta"",
""processors"": """",
""interactions"": """",
""initialStateCheck"": true
},
{
""name"": ""OtherDeviceMove"",
""type"": ""Value"",
""id"": ""303aa640-0c4d-45a5-8ae4-0dfa6592f1ad"",
""expectedControlType"": ""Vector2"",
""processors"": """",
""interactions"": """",
""initialStateCheck"": true
}
],
""bindings"": [
{
""name"": """",
""id"": ""b732aab8-0ac2-4b28-824a-07eb4ebf97a2"",
""path"": ""<Mouse>/leftButton"",
""interactions"": """",
""processors"": """",
""groups"": """",
""action"": ""LeftClick"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""09dd6bb8-d2d7-40f2-a6ee-76e30eb85603"",
""path"": ""<Mouse>/delta"",
""interactions"": """",
""processors"": """",
""groups"": """",
""action"": ""Move"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""4007ad9a-c5ac-4cb8-b421-f77c3571c254"",
""path"": ""<Mouse>/scroll"",
""interactions"": """",
""processors"": """",
""groups"": """",
""action"": ""Zoom"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": """",
""id"": ""280a4426-1dd1-46e8-ae86-c9bb5bbe5a28"",
""path"": ""<Gamepad>/rightStick"",
""interactions"": """",
""processors"": """",
""groups"": """",
""action"": ""OtherDeviceMove"",
""isComposite"": false,
""isPartOfComposite"": false
},
{
""name"": ""Keyboard"",
""id"": ""ccea0acf-3d0b-4f23-a05b-13ea83fa87ed"",
""path"": ""2DVector"",
""interactions"": """",
""processors"": """",
""groups"": """",
""action"": ""OtherDeviceMove"",
""isComposite"": true,
""isPartOfComposite"": false
},
{
""name"": ""up"",
""id"": ""c4961633-a734-46d0-b953-3e432e3b49ab"",
""path"": ""<Keyboard>/upArrow"",
""interactions"": """",
""processors"": """",
""groups"": """",
""action"": ""OtherDeviceMove"",
""isComposite"": false,
""isPartOfComposite"": true
},
{
""name"": ""down"",
""id"": ""61529c7e-8f00-4e79-8161-d1bea1a0e1bd"",
""path"": ""<Keyboard>/downArrow"",
""interactions"": """",
""processors"": """",
""groups"": """",
""action"": ""OtherDeviceMove"",
""isComposite"": false,
""isPartOfComposite"": true
},
{
""name"": ""left"",
""id"": ""56e0e33d-9c76-4a5f-ab03-bddeaafe00bb"",
""path"": ""<Keyboard>/leftArrow"",
""interactions"": """",
""processors"": """",
""groups"": """",
""action"": ""OtherDeviceMove"",
""isComposite"": false,
""isPartOfComposite"": true
},
{
""name"": ""right"",
""id"": ""95163d60-9c38-4604-a7cd-ea70be81726c"",
""path"": ""<Keyboard>/rightArrow"",
""interactions"": """",
""processors"": """",
""groups"": """",
""action"": ""OtherDeviceMove"",
""isComposite"": false,
""isPartOfComposite"": true
}
]
}
],
""controlSchemes"": []
}");
// Tree
m_Tree = asset.FindActionMap("Tree", throwIfNotFound: true);
m_Tree_LeftClick = m_Tree.FindAction("LeftClick", throwIfNotFound: true);
m_Tree_Move = m_Tree.FindAction("Move", throwIfNotFound: true);
m_Tree_Zoom = m_Tree.FindAction("Zoom", throwIfNotFound: true);
m_Tree_OtherDeviceMove = m_Tree.FindAction("OtherDeviceMove", 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);
}
// Tree
private readonly InputActionMap m_Tree;
private List<ITreeActions> m_TreeActionsCallbackInterfaces = new List<ITreeActions>();
private readonly InputAction m_Tree_LeftClick;
private readonly InputAction m_Tree_Move;
private readonly InputAction m_Tree_Zoom;
private readonly InputAction m_Tree_OtherDeviceMove;
public struct TreeActions
{
private @CameraMove m_Wrapper;
public TreeActions(@CameraMove wrapper) { m_Wrapper = wrapper; }
public InputAction @LeftClick => m_Wrapper.m_Tree_LeftClick;
public InputAction @Move => m_Wrapper.m_Tree_Move;
public InputAction @Zoom => m_Wrapper.m_Tree_Zoom;
public InputAction @OtherDeviceMove => m_Wrapper.m_Tree_OtherDeviceMove;
public InputActionMap Get() { return m_Wrapper.m_Tree; }
public void Enable() { Get().Enable(); }
public void Disable() { Get().Disable(); }
public bool enabled => Get().enabled;
public static implicit operator InputActionMap(TreeActions set) { return set.Get(); }
public void AddCallbacks(ITreeActions instance)
{
if (instance == null || m_Wrapper.m_TreeActionsCallbackInterfaces.Contains(instance)) return;
m_Wrapper.m_TreeActionsCallbackInterfaces.Add(instance);
@LeftClick.started += instance.OnLeftClick;
@LeftClick.performed += instance.OnLeftClick;
@LeftClick.canceled += instance.OnLeftClick;
@Move.started += instance.OnMove;
@Move.performed += instance.OnMove;
@Move.canceled += instance.OnMove;
@Zoom.started += instance.OnZoom;
@Zoom.performed += instance.OnZoom;
@Zoom.canceled += instance.OnZoom;
@OtherDeviceMove.started += instance.OnOtherDeviceMove;
@OtherDeviceMove.performed += instance.OnOtherDeviceMove;
@OtherDeviceMove.canceled += instance.OnOtherDeviceMove;
}
private void UnregisterCallbacks(ITreeActions instance)
{
@LeftClick.started -= instance.OnLeftClick;
@LeftClick.performed -= instance.OnLeftClick;
@LeftClick.canceled -= instance.OnLeftClick;
@Move.started -= instance.OnMove;
@Move.performed -= instance.OnMove;
@Move.canceled -= instance.OnMove;
@Zoom.started -= instance.OnZoom;
@Zoom.performed -= instance.OnZoom;
@Zoom.canceled -= instance.OnZoom;
@OtherDeviceMove.started -= instance.OnOtherDeviceMove;
@OtherDeviceMove.performed -= instance.OnOtherDeviceMove;
@OtherDeviceMove.canceled -= instance.OnOtherDeviceMove;
}
public void RemoveCallbacks(ITreeActions instance)
{
if (m_Wrapper.m_TreeActionsCallbackInterfaces.Remove(instance))
UnregisterCallbacks(instance);
}
public void SetCallbacks(ITreeActions instance)
{
foreach (var item in m_Wrapper.m_TreeActionsCallbackInterfaces)
UnregisterCallbacks(item);
m_Wrapper.m_TreeActionsCallbackInterfaces.Clear();
AddCallbacks(instance);
}
}
public TreeActions @Tree => new TreeActions(this);
public interface ITreeActions
{
void OnLeftClick(InputAction.CallbackContext context);
void OnMove(InputAction.CallbackContext context);
void OnZoom(InputAction.CallbackContext context);
void OnOtherDeviceMove(InputAction.CallbackContext context);
}
}