добавил немного функционала
This commit is contained in:
@@ -0,0 +1,152 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was auto-generated by com.unity.inputsystem:InputActionCodeGenerator
|
||||
// version 1.4.3
|
||||
// from Assets/Settings/Input/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 @Controls : IInputActionCollection2, IDisposable
|
||||
{
|
||||
public InputActionAsset asset { get; }
|
||||
public @Controls()
|
||||
{
|
||||
asset = InputActionAsset.FromJson(@"{
|
||||
""name"": ""Controls"",
|
||||
""maps"": [
|
||||
{
|
||||
""name"": ""Rotation"",
|
||||
""id"": ""f566e871-f7ed-447f-833e-f81e4d7c2ea1"",
|
||||
""actions"": [
|
||||
{
|
||||
""name"": ""Gyroscope"",
|
||||
""type"": ""Value"",
|
||||
""id"": ""ea866944-939a-4640-91ef-2a14c18ec769"",
|
||||
""expectedControlType"": ""Quaternion"",
|
||||
""processors"": """",
|
||||
""interactions"": """",
|
||||
""initialStateCheck"": true
|
||||
}
|
||||
],
|
||||
""bindings"": [
|
||||
{
|
||||
""name"": """",
|
||||
""id"": ""afa02e30-18c6-4d01-b604-37a7120d23c7"",
|
||||
""path"": ""<AttitudeSensor>/attitude"",
|
||||
""interactions"": """",
|
||||
""processors"": """",
|
||||
""groups"": """",
|
||||
""action"": ""Gyroscope"",
|
||||
""isComposite"": false,
|
||||
""isPartOfComposite"": false
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
""controlSchemes"": []
|
||||
}");
|
||||
// Rotation
|
||||
m_Rotation = asset.FindActionMap("Rotation", throwIfNotFound: true);
|
||||
m_Rotation_Gyroscope = m_Rotation.FindAction("Gyroscope", 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);
|
||||
}
|
||||
|
||||
// Rotation
|
||||
private readonly InputActionMap m_Rotation;
|
||||
private IRotationActions m_RotationActionsCallbackInterface;
|
||||
private readonly InputAction m_Rotation_Gyroscope;
|
||||
public struct RotationActions
|
||||
{
|
||||
private @Controls m_Wrapper;
|
||||
public RotationActions(@Controls wrapper) { m_Wrapper = wrapper; }
|
||||
public InputAction @Gyroscope => m_Wrapper.m_Rotation_Gyroscope;
|
||||
public InputActionMap Get() { return m_Wrapper.m_Rotation; }
|
||||
public void Enable() { Get().Enable(); }
|
||||
public void Disable() { Get().Disable(); }
|
||||
public bool enabled => Get().enabled;
|
||||
public static implicit operator InputActionMap(RotationActions set) { return set.Get(); }
|
||||
public void SetCallbacks(IRotationActions instance)
|
||||
{
|
||||
if (m_Wrapper.m_RotationActionsCallbackInterface != null)
|
||||
{
|
||||
@Gyroscope.started -= m_Wrapper.m_RotationActionsCallbackInterface.OnGyroscope;
|
||||
@Gyroscope.performed -= m_Wrapper.m_RotationActionsCallbackInterface.OnGyroscope;
|
||||
@Gyroscope.canceled -= m_Wrapper.m_RotationActionsCallbackInterface.OnGyroscope;
|
||||
}
|
||||
m_Wrapper.m_RotationActionsCallbackInterface = instance;
|
||||
if (instance != null)
|
||||
{
|
||||
@Gyroscope.started += instance.OnGyroscope;
|
||||
@Gyroscope.performed += instance.OnGyroscope;
|
||||
@Gyroscope.canceled += instance.OnGyroscope;
|
||||
}
|
||||
}
|
||||
}
|
||||
public RotationActions @Rotation => new RotationActions(this);
|
||||
public interface IRotationActions
|
||||
{
|
||||
void OnGyroscope(InputAction.CallbackContext context);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e5c439bb69039ca44adbbea67e91c962
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,34 @@
|
||||
{
|
||||
"name": "Controls",
|
||||
"maps": [
|
||||
{
|
||||
"name": "Rotation",
|
||||
"id": "f566e871-f7ed-447f-833e-f81e4d7c2ea1",
|
||||
"actions": [
|
||||
{
|
||||
"name": "Gyroscope",
|
||||
"type": "Value",
|
||||
"id": "ea866944-939a-4640-91ef-2a14c18ec769",
|
||||
"expectedControlType": "Quaternion",
|
||||
"processors": "",
|
||||
"interactions": "",
|
||||
"initialStateCheck": true
|
||||
}
|
||||
],
|
||||
"bindings": [
|
||||
{
|
||||
"name": "",
|
||||
"id": "afa02e30-18c6-4d01-b604-37a7120d23c7",
|
||||
"path": "<AttitudeSensor>/attitude",
|
||||
"interactions": "",
|
||||
"processors": "",
|
||||
"groups": "",
|
||||
"action": "Gyroscope",
|
||||
"isComposite": false,
|
||||
"isPartOfComposite": false
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"controlSchemes": []
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0a7c9770ab54b8f47884dcfe46cbafe4
|
||||
ScriptedImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
script: {fileID: 11500000, guid: 8404be70184654265930450def6a9037, type: 3}
|
||||
generateWrapperCode: 1
|
||||
wrapperCodePath:
|
||||
wrapperClassName:
|
||||
wrapperCodeNamespace:
|
||||
Reference in New Issue
Block a user