277 lines
10 KiB
C#
277 lines
10 KiB
C#
//------------------------------------------------------------------------------
|
|
// <auto-generated>
|
|
// This code was auto-generated by com.unity.inputsystem:InputActionCodeGenerator
|
|
// version 1.11.1
|
|
// from Assets/InputSystem/CameraControllActions.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 @CameraControllActions: IInputActionCollection2, IDisposable
|
|
{
|
|
public InputActionAsset asset { get; }
|
|
public @CameraControllActions()
|
|
{
|
|
asset = InputActionAsset.FromJson(@"{
|
|
""name"": ""CameraControllActions"",
|
|
""maps"": [
|
|
{
|
|
""name"": ""Camera"",
|
|
""id"": ""e56b92c5-8fd9-4498-967b-a8a289d2ea2d"",
|
|
""actions"": [
|
|
{
|
|
""name"": ""Movement"",
|
|
""type"": ""Value"",
|
|
""id"": ""6d1751e7-bc18-45f3-ba28-1945c0630170"",
|
|
""expectedControlType"": ""Vector2"",
|
|
""processors"": """",
|
|
""interactions"": """",
|
|
""initialStateCheck"": true
|
|
},
|
|
{
|
|
""name"": ""RotateCamera"",
|
|
""type"": ""Value"",
|
|
""id"": ""78a37640-f3de-4ef4-8ce2-48f71344fbad"",
|
|
""expectedControlType"": ""Vector2"",
|
|
""processors"": """",
|
|
""interactions"": """",
|
|
""initialStateCheck"": true
|
|
},
|
|
{
|
|
""name"": ""ZoomCamera"",
|
|
""type"": ""Value"",
|
|
""id"": ""21086730-75a8-43cc-8b53-0ee2b54bf01f"",
|
|
""expectedControlType"": ""Vector2"",
|
|
""processors"": """",
|
|
""interactions"": """",
|
|
""initialStateCheck"": true
|
|
}
|
|
],
|
|
""bindings"": [
|
|
{
|
|
""name"": ""2D Vector"",
|
|
""id"": ""47f89b9c-94ea-4afd-afcb-3b77e0ec6033"",
|
|
""path"": ""2DVector"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""Movement"",
|
|
""isComposite"": true,
|
|
""isPartOfComposite"": false
|
|
},
|
|
{
|
|
""name"": ""up"",
|
|
""id"": ""34de0da3-759c-4218-b44d-920d156ddf0e"",
|
|
""path"": ""<Keyboard>/w"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""Movement"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": true
|
|
},
|
|
{
|
|
""name"": ""down"",
|
|
""id"": ""f9926638-c705-4e78-8b9a-ff59ab5326ec"",
|
|
""path"": ""<Keyboard>/s"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""Movement"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": true
|
|
},
|
|
{
|
|
""name"": ""left"",
|
|
""id"": ""53b6113e-e4f1-4b87-80a5-19c43df102c7"",
|
|
""path"": ""<Keyboard>/a"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""Movement"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": true
|
|
},
|
|
{
|
|
""name"": ""right"",
|
|
""id"": ""aa5061e6-662a-4969-b742-18ef7f2332e5"",
|
|
""path"": ""<Keyboard>/d"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""Movement"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": true
|
|
},
|
|
{
|
|
""name"": """",
|
|
""id"": ""305c7967-8fb9-4245-9d9f-70e40c553777"",
|
|
""path"": ""<Mouse>/delta"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""RotateCamera"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": false
|
|
},
|
|
{
|
|
""name"": """",
|
|
""id"": ""cd712463-c5f3-49e7-877c-51c6f3440413"",
|
|
""path"": ""<Mouse>/scroll"",
|
|
""interactions"": """",
|
|
""processors"": """",
|
|
""groups"": """",
|
|
""action"": ""ZoomCamera"",
|
|
""isComposite"": false,
|
|
""isPartOfComposite"": false
|
|
}
|
|
]
|
|
}
|
|
],
|
|
""controlSchemes"": []
|
|
}");
|
|
// Camera
|
|
m_Camera = asset.FindActionMap("Camera", throwIfNotFound: true);
|
|
m_Camera_Movement = m_Camera.FindAction("Movement", throwIfNotFound: true);
|
|
m_Camera_RotateCamera = m_Camera.FindAction("RotateCamera", throwIfNotFound: true);
|
|
m_Camera_ZoomCamera = m_Camera.FindAction("ZoomCamera", throwIfNotFound: true);
|
|
}
|
|
|
|
~@CameraControllActions()
|
|
{
|
|
UnityEngine.Debug.Assert(!m_Camera.enabled, "This will cause a leak and performance issues, CameraControllActions.Camera.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);
|
|
}
|
|
|
|
// Camera
|
|
private readonly InputActionMap m_Camera;
|
|
private List<ICameraActions> m_CameraActionsCallbackInterfaces = new List<ICameraActions>();
|
|
private readonly InputAction m_Camera_Movement;
|
|
private readonly InputAction m_Camera_RotateCamera;
|
|
private readonly InputAction m_Camera_ZoomCamera;
|
|
public struct CameraActions
|
|
{
|
|
private @CameraControllActions m_Wrapper;
|
|
public CameraActions(@CameraControllActions wrapper) { m_Wrapper = wrapper; }
|
|
public InputAction @Movement => m_Wrapper.m_Camera_Movement;
|
|
public InputAction @RotateCamera => m_Wrapper.m_Camera_RotateCamera;
|
|
public InputAction @ZoomCamera => m_Wrapper.m_Camera_ZoomCamera;
|
|
public InputActionMap Get() { return m_Wrapper.m_Camera; }
|
|
public void Enable() { Get().Enable(); }
|
|
public void Disable() { Get().Disable(); }
|
|
public bool enabled => Get().enabled;
|
|
public static implicit operator InputActionMap(CameraActions set) { return set.Get(); }
|
|
public void AddCallbacks(ICameraActions instance)
|
|
{
|
|
if (instance == null || m_Wrapper.m_CameraActionsCallbackInterfaces.Contains(instance)) return;
|
|
m_Wrapper.m_CameraActionsCallbackInterfaces.Add(instance);
|
|
@Movement.started += instance.OnMovement;
|
|
@Movement.performed += instance.OnMovement;
|
|
@Movement.canceled += instance.OnMovement;
|
|
@RotateCamera.started += instance.OnRotateCamera;
|
|
@RotateCamera.performed += instance.OnRotateCamera;
|
|
@RotateCamera.canceled += instance.OnRotateCamera;
|
|
@ZoomCamera.started += instance.OnZoomCamera;
|
|
@ZoomCamera.performed += instance.OnZoomCamera;
|
|
@ZoomCamera.canceled += instance.OnZoomCamera;
|
|
}
|
|
|
|
private void UnregisterCallbacks(ICameraActions instance)
|
|
{
|
|
@Movement.started -= instance.OnMovement;
|
|
@Movement.performed -= instance.OnMovement;
|
|
@Movement.canceled -= instance.OnMovement;
|
|
@RotateCamera.started -= instance.OnRotateCamera;
|
|
@RotateCamera.performed -= instance.OnRotateCamera;
|
|
@RotateCamera.canceled -= instance.OnRotateCamera;
|
|
@ZoomCamera.started -= instance.OnZoomCamera;
|
|
@ZoomCamera.performed -= instance.OnZoomCamera;
|
|
@ZoomCamera.canceled -= instance.OnZoomCamera;
|
|
}
|
|
|
|
public void RemoveCallbacks(ICameraActions instance)
|
|
{
|
|
if (m_Wrapper.m_CameraActionsCallbackInterfaces.Remove(instance))
|
|
UnregisterCallbacks(instance);
|
|
}
|
|
|
|
public void SetCallbacks(ICameraActions instance)
|
|
{
|
|
foreach (var item in m_Wrapper.m_CameraActionsCallbackInterfaces)
|
|
UnregisterCallbacks(item);
|
|
m_Wrapper.m_CameraActionsCallbackInterfaces.Clear();
|
|
AddCallbacks(instance);
|
|
}
|
|
}
|
|
public CameraActions @Camera => new CameraActions(this);
|
|
public interface ICameraActions
|
|
{
|
|
void OnMovement(InputAction.CallbackContext context);
|
|
void OnRotateCamera(InputAction.CallbackContext context);
|
|
void OnZoomCamera(InputAction.CallbackContext context);
|
|
}
|
|
}
|