From 92fb39bf3aa050437ccc8f3e333b13a7d64bbac4 Mon Sep 17 00:00:00 2001 From: Rene Damm Date: Tue, 6 Aug 2019 13:40:04 +0200 Subject: [PATCH] NEW: Add sample with components for visualizing control and action activity (#754). --- .yamato/upm-ci.yml | 2 + .../SimpleController_UsingEvents.cs | 4 +- Assets/Samples.meta | 8 + Assets/Samples/VisualizerSamples.meta | 8 + Assets/Samples/VisualizerSamples/.sample.json | 4 + .../VisualizerSamples/GamepadVis.prefab | 1289 +++++++++++++++++ .../VisualizerSamples/GamepadVis.prefab.meta | 7 + .../VisualizerSamples/GamepadVisualizer.unity | 274 ++++ .../GamepadVisualizer.unity.meta | 7 + .../InputActionVisualizer.cs | 322 ++++ .../InputActionVisualizer.cs.meta | 11 + .../InputControlVisualizer.cs | 359 +++++ .../InputControlVisualizer.cs.meta | 11 + .../VisualizerSamples/InputVisualizer.cs | 80 + .../VisualizerSamples/InputVisualizer.cs.meta | 11 + .../Samples/VisualizerSamples/MouseVis.prefab | 561 +++++++ .../VisualizerSamples/MouseVis.prefab.meta | 7 + .../VisualizerSamples/MouseVisualizer.unity | 274 ++++ .../MouseVisualizer.unity.meta | 7 + .../Samples/VisualizerSamples/PenVis.prefab | 897 ++++++++++++ .../VisualizerSamples/PenVis.prefab.meta | 7 + .../VisualizerSamples/PenVisualizer.unity | 274 ++++ .../PenVisualizer.unity.meta | 7 + .../SimpleControls.inputactions | 170 +++ .../SimpleControls.inputactions.meta | 14 + .../SimpleControlsVis.prefab | 291 ++++ .../SimpleControlsVis.prefab.meta | 7 + .../SimpleControlsVisualizer.unity | 337 +++++ .../SimpleControlsVisualizer.unity.meta | 7 + .../VisualizerSamples/VisualizationHelpers.cs | 670 +++++++++ .../VisualizationHelpers.cs.meta | 11 + .../Tests/InputSystem/CorePerformanceTests.cs | 56 +- Assets/Tests/InputSystem/CoreTests_Actions.cs | 49 +- .../Tests/InputSystem/CoreTests_Controls.cs | 11 +- Assets/Tests/InputSystem/CoreTests_Editor.cs | 2 +- Assets/Tests/InputSystem/CoreTests_Events.cs | 29 +- Assets/Tests/InputSystem/CoreTests_State.cs | 54 +- .../InputSystem/Plugins/EnhancedTouchTests.cs | 1 + .../Tests/InputSystem/Plugins/SteamTests.cs | 6 +- .../InputSystem/Utilities/ArrayHelperTests.cs | 1 + Packages/com.unity.inputsystem/CHANGELOG.md | 27 + .../Documentation~/Debugging.md | 54 +- .../InputSystem/Actions/InputAction.cs | 144 +- .../Actions/InputActionRebindingExtensions.cs | 9 +- .../InputSystem/Actions/InputActionState.cs | 2 +- .../Controls/InputControlLayout.cs | 18 + .../Devices/Remote/InputRemoting.cs | 4 +- .../ControlPicker/InputControlPathEditor.cs | 7 +- .../Debugger/InputDeviceDebuggerWindow.cs | 4 +- .../InputSystem/Events/InputEventTrace.cs | 2 +- .../InputSystem/InputManager.cs | 9 +- .../InputSystem/InputSystem.cs | 59 +- .../Plugins/EnhancedTouch/TouchSimulation.cs | 2 +- .../InputSystem/State/InputState.cs | 8 +- .../InputSystem/State/InputStateHistory.cs | 2 +- .../InputSystem/Utilities/PrimitiveValue.cs | 22 +- .../InputSystem/Utilities/TypeHelpers.cs | 1 - Packages/manifest.json | 94 +- 58 files changed, 6445 insertions(+), 170 deletions(-) create mode 100644 Assets/Samples.meta create mode 100644 Assets/Samples/VisualizerSamples.meta create mode 100644 Assets/Samples/VisualizerSamples/.sample.json create mode 100644 Assets/Samples/VisualizerSamples/GamepadVis.prefab create mode 100644 Assets/Samples/VisualizerSamples/GamepadVis.prefab.meta create mode 100644 Assets/Samples/VisualizerSamples/GamepadVisualizer.unity create mode 100644 Assets/Samples/VisualizerSamples/GamepadVisualizer.unity.meta create mode 100644 Assets/Samples/VisualizerSamples/InputActionVisualizer.cs create mode 100644 Assets/Samples/VisualizerSamples/InputActionVisualizer.cs.meta create mode 100644 Assets/Samples/VisualizerSamples/InputControlVisualizer.cs create mode 100644 Assets/Samples/VisualizerSamples/InputControlVisualizer.cs.meta create mode 100644 Assets/Samples/VisualizerSamples/InputVisualizer.cs create mode 100644 Assets/Samples/VisualizerSamples/InputVisualizer.cs.meta create mode 100644 Assets/Samples/VisualizerSamples/MouseVis.prefab create mode 100644 Assets/Samples/VisualizerSamples/MouseVis.prefab.meta create mode 100644 Assets/Samples/VisualizerSamples/MouseVisualizer.unity create mode 100644 Assets/Samples/VisualizerSamples/MouseVisualizer.unity.meta create mode 100644 Assets/Samples/VisualizerSamples/PenVis.prefab create mode 100644 Assets/Samples/VisualizerSamples/PenVis.prefab.meta create mode 100644 Assets/Samples/VisualizerSamples/PenVisualizer.unity create mode 100644 Assets/Samples/VisualizerSamples/PenVisualizer.unity.meta create mode 100644 Assets/Samples/VisualizerSamples/SimpleControls.inputactions create mode 100644 Assets/Samples/VisualizerSamples/SimpleControls.inputactions.meta create mode 100644 Assets/Samples/VisualizerSamples/SimpleControlsVis.prefab create mode 100644 Assets/Samples/VisualizerSamples/SimpleControlsVis.prefab.meta create mode 100644 Assets/Samples/VisualizerSamples/SimpleControlsVisualizer.unity create mode 100644 Assets/Samples/VisualizerSamples/SimpleControlsVisualizer.unity.meta create mode 100644 Assets/Samples/VisualizerSamples/VisualizationHelpers.cs create mode 100644 Assets/Samples/VisualizerSamples/VisualizationHelpers.cs.meta diff --git a/.yamato/upm-ci.yml b/.yamato/upm-ci.yml index 6310828db..3c0786995 100644 --- a/.yamato/upm-ci.yml +++ b/.yamato/upm-ci.yml @@ -43,6 +43,8 @@ platforms: image: {{ platform.image }} flavor: {{ platform.flavor}} commands: + - mv ./Assets/Samples ./Packages/com.unity.inputsystem + - mv ./Assets/Samples.meta ./Packages/com.unity.inputsystem - npm install upm-ci-utils@stable -g --registry https://api.bintray.com/npm/unity/unity-npm - upm-ci package pack --package-path ./Packages/com.unity.inputsystem/ - upm-ci package test --package-path ./Packages/com.unity.inputsystem/ -u {{ editor.version }} diff --git a/Assets/Demo/SimpleDemo/SimpleController_UsingEvents.cs b/Assets/Demo/SimpleDemo/SimpleController_UsingEvents.cs index 4764191b0..727eb62a2 100644 --- a/Assets/Demo/SimpleDemo/SimpleController_UsingEvents.cs +++ b/Assets/Demo/SimpleDemo/SimpleController_UsingEvents.cs @@ -16,9 +16,9 @@ public class SimpleController_UsingEvents : MonoBehaviour public void OnEnable() { InputSystem.onEvent += - eventPtr => + (eventPtr, device) => { - var gamepad = InputSystem.GetDeviceById(eventPtr.deviceId) as Gamepad; + var gamepad = device as Gamepad; if (gamepad == null) return; diff --git a/Assets/Samples.meta b/Assets/Samples.meta new file mode 100644 index 000000000..bcec00c27 --- /dev/null +++ b/Assets/Samples.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8e73f6bdc238e41a4a18c59f74a12f77 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Samples/VisualizerSamples.meta b/Assets/Samples/VisualizerSamples.meta new file mode 100644 index 000000000..71ae8290f --- /dev/null +++ b/Assets/Samples/VisualizerSamples.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 82c13d32934f84c798213f0a5854afec +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Samples/VisualizerSamples/.sample.json b/Assets/Samples/VisualizerSamples/.sample.json new file mode 100644 index 000000000..ea5a862ee --- /dev/null +++ b/Assets/Samples/VisualizerSamples/.sample.json @@ -0,0 +1,4 @@ +{ + "displayName": "Visualizer Samples", + "description": "Examples for setting up input control and action visualizations." +} diff --git a/Assets/Samples/VisualizerSamples/GamepadVis.prefab b/Assets/Samples/VisualizerSamples/GamepadVis.prefab new file mode 100644 index 000000000..b7f519269 --- /dev/null +++ b/Assets/Samples/VisualizerSamples/GamepadVis.prefab @@ -0,0 +1,1289 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &5430831073950378571 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5430831073950378565} + - component: {fileID: 5430831073950378564} + m_Layer: 0 + m_Name: YButton + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5430831073950378565 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5430831073950378571} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -955.3655, y: -464.9797, z: 160.45508} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 5430831075476541851} + m_RootOrder: 11 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &5430831073950378564 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5430831073950378571} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 50c7363fac4d24ae8a679e3e8f1fa838, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Label: Y + m_HistorySamples: 100 + m_TimeWindow: 3 + m_Rect: + serializedVersion: 2 + x: 550 + y: 50 + width: 25 + height: 25 + m_Visualization: 1 + m_ControlPath: /buttonNorth + m_ControlIndex: 0 +--- !u!1 &5430831074071876625 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5430831074071876627} + - component: {fileID: 5430831074071876626} + m_Layer: 0 + m_Name: Select + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5430831074071876627 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5430831074071876625} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -955.3655, y: -464.9797, z: 160.45508} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 5430831075476541851} + m_RootOrder: 13 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &5430831074071876626 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5430831074071876625} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 50c7363fac4d24ae8a679e3e8f1fa838, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Label: Select + m_HistorySamples: 100 + m_TimeWindow: 3 + m_Rect: + serializedVersion: 2 + x: 575 + y: 150 + width: 50 + height: 25 + m_Visualization: 1 + m_ControlPath: /select + m_ControlIndex: 0 +--- !u!1 &5430831074153646138 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5430831074153646132} + - component: {fileID: 5430831074153646139} + m_Layer: 0 + m_Name: LeftTrigger + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5430831074153646132 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5430831074153646138} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -955.3655, y: -464.9797, z: 160.45508} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 5430831075476541851} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &5430831074153646139 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5430831074153646138} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 50c7363fac4d24ae8a679e3e8f1fa838, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Label: LeftTrigger + m_HistorySamples: 100 + m_TimeWindow: 3 + m_Rect: + serializedVersion: 2 + x: 50 + y: 50 + width: 200 + height: 50 + m_Visualization: 1 + m_ControlPath: /leftTrigger + m_ControlIndex: 0 +--- !u!1 &5430831074316365813 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5430831074316365815} + - component: {fileID: 5430831074316365814} + m_Layer: 0 + m_Name: LeftShoulder + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5430831074316365815 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5430831074316365813} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -955.3655, y: -464.9797, z: 160.45508} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 5430831075476541851} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &5430831074316365814 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5430831074316365813} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 50c7363fac4d24ae8a679e3e8f1fa838, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Label: LeftShoulder + m_HistorySamples: 100 + m_TimeWindow: 3 + m_Rect: + serializedVersion: 2 + x: 100 + y: 125 + width: 150 + height: 50 + m_Visualization: 1 + m_ControlPath: /leftShoulder + m_ControlIndex: 0 +--- !u!1 &5430831074333637589 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5430831074333637591} + - component: {fileID: 5430831074333637590} + m_Layer: 0 + m_Name: Events + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5430831074333637591 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5430831074333637589} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 5430831075476541851} + m_RootOrder: 19 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &5430831074333637590 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5430831074333637589} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 50c7363fac4d24ae8a679e3e8f1fa838, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Label: Events + m_HistorySamples: 500 + m_TimeWindow: 3 + m_Rect: + serializedVersion: 2 + x: 20 + y: 375 + width: 700 + height: 70 + m_Visualization: 4 + m_ControlPath: + m_ControlIndex: 0 +--- !u!1 &5430831074406035309 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5430831074406035311} + - component: {fileID: 5430831074406035310} + m_Layer: 0 + m_Name: DpadUp + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5430831074406035311 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5430831074406035309} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -955.3655, y: -464.9797, z: 160.45508} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 5430831075476541851} + m_RootOrder: 17 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &5430831074406035310 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5430831074406035309} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 50c7363fac4d24ae8a679e3e8f1fa838, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Label: DU + m_HistorySamples: 100 + m_TimeWindow: 3 + m_Rect: + serializedVersion: 2 + x: 525 + y: 225 + width: 25 + height: 25 + m_Visualization: 1 + m_ControlPath: /dpad/up + m_ControlIndex: 0 +--- !u!1 &5430831074569589721 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5430831074569589723} + - component: {fileID: 5430831074569589722} + m_Layer: 0 + m_Name: LeftStickPress + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5430831074569589723 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5430831074569589721} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -955.3655, y: -464.9797, z: 160.45508} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 5430831075476541851} + m_RootOrder: 6 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &5430831074569589722 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5430831074569589721} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 50c7363fac4d24ae8a679e3e8f1fa838, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Label: LS + m_HistorySamples: 100 + m_TimeWindow: 3 + m_Rect: + serializedVersion: 2 + x: 50 + y: 200 + width: 25 + height: 50 + m_Visualization: 1 + m_ControlPath: /leftStickPress + m_ControlIndex: 0 +--- !u!1 &5430831074657706042 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5430831074657706036} + - component: {fileID: 5430831074657706043} + m_Layer: 0 + m_Name: RightShoulder + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5430831074657706036 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5430831074657706042} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -955.3655, y: -464.9797, z: 160.45508} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 5430831075476541851} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &5430831074657706043 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5430831074657706042} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 50c7363fac4d24ae8a679e3e8f1fa838, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Label: RightShoulder + m_HistorySamples: 100 + m_TimeWindow: 3 + m_Rect: + serializedVersion: 2 + x: 275 + y: 125 + width: 150 + height: 50 + m_Visualization: 1 + m_ControlPath: /rightShoulder + m_ControlIndex: 0 +--- !u!1 &5430831074722065633 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5430831074722065635} + - component: {fileID: 5430831074722065634} + m_Layer: 0 + m_Name: Dpad + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5430831074722065635 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5430831074722065633} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -955.3655, y: -464.9797, z: 160.45508} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 5430831075476541851} + m_RootOrder: 18 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &5430831074722065634 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5430831074722065633} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 50c7363fac4d24ae8a679e3e8f1fa838, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Label: Dpad + m_HistorySamples: 100 + m_TimeWindow: 3 + m_Rect: + serializedVersion: 2 + x: 600 + y: 200 + width: 150 + height: 150 + m_Visualization: 1 + m_ControlPath: /dpad + m_ControlIndex: 0 +--- !u!1 &5430831074890777055 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5430831074890777049} + - component: {fileID: 5430831074890777048} + m_Layer: 0 + m_Name: XButton + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5430831074890777049 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5430831074890777055} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -955.3655, y: -464.9797, z: 160.45508} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 5430831075476541851} + m_RootOrder: 10 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &5430831074890777048 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5430831074890777055} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 50c7363fac4d24ae8a679e3e8f1fa838, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Label: X + m_HistorySamples: 100 + m_TimeWindow: 3 + m_Rect: + serializedVersion: 2 + x: 525 + y: 75 + width: 25 + height: 25 + m_Visualization: 1 + m_ControlPath: /buttonWest + m_ControlIndex: 0 +--- !u!1 &5430831074908778958 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5430831074908778952} + - component: {fileID: 5430831074908778959} + m_Layer: 0 + m_Name: BButton + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5430831074908778952 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5430831074908778958} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -955.3655, y: -464.9797, z: 160.45508} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 5430831075476541851} + m_RootOrder: 9 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &5430831074908778959 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5430831074908778958} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 50c7363fac4d24ae8a679e3e8f1fa838, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Label: B + m_HistorySamples: 100 + m_TimeWindow: 3 + m_Rect: + serializedVersion: 2 + x: 575 + y: 75 + width: 25 + height: 25 + m_Visualization: 1 + m_ControlPath: /buttonEast + m_ControlIndex: 0 +--- !u!1 &5430831074960731593 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5430831074960731595} + - component: {fileID: 5430831074960731594} + m_Layer: 0 + m_Name: DpadDown + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5430831074960731595 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5430831074960731593} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -955.3655, y: -464.9797, z: 160.45508} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 5430831075476541851} + m_RootOrder: 14 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &5430831074960731594 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5430831074960731593} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 50c7363fac4d24ae8a679e3e8f1fa838, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Label: DN + m_HistorySamples: 100 + m_TimeWindow: 3 + m_Rect: + serializedVersion: 2 + x: 525 + y: 275 + width: 25 + height: 25 + m_Visualization: 1 + m_ControlPath: /dpad/down + m_ControlIndex: 0 +--- !u!1 &5430831075105443482 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5430831075105443476} + - component: {fileID: 5430831075105443483} + m_Layer: 0 + m_Name: DpadLeft + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5430831075105443476 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5430831075105443482} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -955.3655, y: -464.9797, z: 160.45508} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 5430831075476541851} + m_RootOrder: 16 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &5430831075105443483 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5430831075105443482} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 50c7363fac4d24ae8a679e3e8f1fa838, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Label: DL + m_HistorySamples: 100 + m_TimeWindow: 3 + m_Rect: + serializedVersion: 2 + x: 500 + y: 250 + width: 25 + height: 25 + m_Visualization: 1 + m_ControlPath: /dpad/left + m_ControlIndex: 0 +--- !u!1 &5430831075159756557 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5430831075159756559} + - component: {fileID: 5430831075159756558} + m_Layer: 0 + m_Name: Start + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5430831075159756559 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5430831075159756557} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -955.3655, y: -464.9797, z: 160.45508} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 5430831075476541851} + m_RootOrder: 12 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &5430831075159756558 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5430831075159756557} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 50c7363fac4d24ae8a679e3e8f1fa838, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Label: Start + m_HistorySamples: 100 + m_TimeWindow: 3 + m_Rect: + serializedVersion: 2 + x: 500 + y: 150 + width: 50 + height: 25 + m_Visualization: 1 + m_ControlPath: /start + m_ControlIndex: 0 +--- !u!1 &5430831075192722347 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5430831075192722341} + - component: {fileID: 5430831075192722340} + m_Layer: 0 + m_Name: RightStick + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5430831075192722341 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5430831075192722347} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -955.3655, y: -464.9797, z: 160.45508} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 5430831075476541851} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &5430831075192722340 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5430831075192722347} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 50c7363fac4d24ae8a679e3e8f1fa838, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Label: RightStick + m_HistorySamples: 100 + m_TimeWindow: 3 + m_Rect: + serializedVersion: 2 + x: 275 + y: 200 + width: 150 + height: 150 + m_Visualization: 1 + m_ControlPath: /rightStick + m_ControlIndex: 0 +--- !u!1 &5430831075336578712 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5430831075336578714} + - component: {fileID: 5430831075336578713} + m_Layer: 0 + m_Name: DpadRight + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5430831075336578714 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5430831075336578712} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -955.3655, y: -464.9797, z: 160.45508} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 5430831075476541851} + m_RootOrder: 15 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &5430831075336578713 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5430831075336578712} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 50c7363fac4d24ae8a679e3e8f1fa838, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Label: DR + m_HistorySamples: 100 + m_TimeWindow: 3 + m_Rect: + serializedVersion: 2 + x: 550 + y: 250 + width: 25 + height: 25 + m_Visualization: 1 + m_ControlPath: /dpad/right + m_ControlIndex: 0 +--- !u!1 &5430831075476541849 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5430831075476541851} + - component: {fileID: 5430831075476541850} + m_Layer: 0 + m_Name: GamepadVis + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5430831075476541851 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5430831075476541849} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 955.3655, y: 464.9797, z: -160.45508} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 5430831075516136792} + - {fileID: 5430831075192722341} + - {fileID: 5430831074316365815} + - {fileID: 5430831074657706036} + - {fileID: 5430831074153646132} + - {fileID: 5430831075958221746} + - {fileID: 5430831074569589723} + - {fileID: 5430831075882524475} + - {fileID: 5430831075990510061} + - {fileID: 5430831074908778952} + - {fileID: 5430831074890777049} + - {fileID: 5430831073950378565} + - {fileID: 5430831075159756559} + - {fileID: 5430831074071876627} + - {fileID: 5430831074960731595} + - {fileID: 5430831075336578714} + - {fileID: 5430831075105443476} + - {fileID: 5430831074406035311} + - {fileID: 5430831074722065635} + - {fileID: 5430831074333637591} + - {fileID: 5430831075888579013} + - {fileID: 5430831075640135792} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &5430831075476541850 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5430831075476541849} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 50c7363fac4d24ae8a679e3e8f1fa838, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Label: + m_HistorySamples: 500 + m_TimeWindow: 3 + m_Rect: + serializedVersion: 2 + x: 3.76 + y: -24.4 + width: 300 + height: 30 + m_Visualization: 0 + m_ControlPath: + m_ControlIndex: 0 +--- !u!1 &5430831075516136798 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5430831075516136792} + - component: {fileID: 5430831075516136799} + m_Layer: 0 + m_Name: LeftStick + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5430831075516136792 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5430831075516136798} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -955.3655, y: -464.9797, z: 160.45508} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 5430831075476541851} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &5430831075516136799 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5430831075516136798} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 50c7363fac4d24ae8a679e3e8f1fa838, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Label: LeftStick + m_HistorySamples: 100 + m_TimeWindow: 3 + m_Rect: + serializedVersion: 2 + x: 100 + y: 200 + width: 150 + height: 150 + m_Visualization: 1 + m_ControlPath: /leftStick + m_ControlIndex: 0 +--- !u!1 &5430831075640135799 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5430831075640135792} + - component: {fileID: 5430831075640135793} + m_Layer: 0 + m_Name: Bytes + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5430831075640135792 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5430831075640135799} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 5430831075476541851} + m_RootOrder: 21 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &5430831075640135793 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5430831075640135799} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 50c7363fac4d24ae8a679e3e8f1fa838, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Label: Bytes + m_HistorySamples: 500 + m_TimeWindow: 3 + m_Rect: + serializedVersion: 2 + x: 20 + y: 550 + width: 700 + height: 70 + m_Visualization: 7 + m_ControlPath: + m_ControlIndex: 0 +--- !u!1 &5430831075882524473 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5430831075882524475} + - component: {fileID: 5430831075882524474} + m_Layer: 0 + m_Name: RightStickPress + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5430831075882524475 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5430831075882524473} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -955.3655, y: -464.9797, z: 160.45508} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 5430831075476541851} + m_RootOrder: 7 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &5430831075882524474 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5430831075882524473} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 50c7363fac4d24ae8a679e3e8f1fa838, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Label: RS + m_HistorySamples: 100 + m_TimeWindow: 3 + m_Rect: + serializedVersion: 2 + x: 450 + y: 200 + width: 25 + height: 50 + m_Visualization: 1 + m_ControlPath: /rightStickPress + m_ControlIndex: 0 +--- !u!1 &5430831075888579012 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5430831075888579013} + - component: {fileID: 5430831075888579014} + m_Layer: 0 + m_Name: Lag + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5430831075888579013 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5430831075888579012} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 5430831075476541851} + m_RootOrder: 20 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &5430831075888579014 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5430831075888579012} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 50c7363fac4d24ae8a679e3e8f1fa838, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Label: Lag (ms) + m_HistorySamples: 500 + m_TimeWindow: 3 + m_Rect: + serializedVersion: 2 + x: 20 + y: 460 + width: 700 + height: 70 + m_Visualization: 6 + m_ControlPath: + m_ControlIndex: 0 +--- !u!1 &5430831075958221744 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5430831075958221746} + - component: {fileID: 5430831075958221745} + m_Layer: 0 + m_Name: RightTrigger + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5430831075958221746 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5430831075958221744} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -955.3655, y: -464.9797, z: 160.45508} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 5430831075476541851} + m_RootOrder: 5 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &5430831075958221745 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5430831075958221744} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 50c7363fac4d24ae8a679e3e8f1fa838, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Label: RightTrigger + m_HistorySamples: 100 + m_TimeWindow: 3 + m_Rect: + serializedVersion: 2 + x: 275 + y: 50 + width: 200 + height: 50 + m_Visualization: 1 + m_ControlPath: /rightTrigger + m_ControlIndex: 0 +--- !u!1 &5430831075990510035 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5430831075990510061} + - component: {fileID: 5430831075990510060} + m_Layer: 0 + m_Name: AButton + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &5430831075990510061 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5430831075990510035} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -955.3655, y: -464.9797, z: 160.45508} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 5430831075476541851} + m_RootOrder: 8 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &5430831075990510060 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5430831075990510035} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 50c7363fac4d24ae8a679e3e8f1fa838, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Label: A + m_HistorySamples: 100 + m_TimeWindow: 3 + m_Rect: + serializedVersion: 2 + x: 550 + y: 100 + width: 25 + height: 25 + m_Visualization: 1 + m_ControlPath: /buttonSouth + m_ControlIndex: 0 diff --git a/Assets/Samples/VisualizerSamples/GamepadVis.prefab.meta b/Assets/Samples/VisualizerSamples/GamepadVis.prefab.meta new file mode 100644 index 000000000..0cbb70870 --- /dev/null +++ b/Assets/Samples/VisualizerSamples/GamepadVis.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: b8429651427a640919754290f3704312 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Samples/VisualizerSamples/GamepadVisualizer.unity b/Assets/Samples/VisualizerSamples/GamepadVisualizer.unity new file mode 100644 index 000000000..ed3b020d5 --- /dev/null +++ b/Assets/Samples/VisualizerSamples/GamepadVisualizer.unity @@ -0,0 +1,274 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 11 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 1 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ShowResolutionOverlay: 1 + m_ExportTrainingData: 0 + m_LightingDataAsset: {fileID: 0} + m_UseShadowmask: 1 +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &676010914 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 676010918} + - component: {fileID: 676010917} + - component: {fileID: 676010916} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!81 &676010916 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 676010914} + m_Enabled: 1 +--- !u!20 &676010917 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 676010914} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 2 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_FocalLength: 50 + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 60 + orthographic: 0 + orthographic size: 5 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!4 &676010918 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 676010914} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 1, z: -10} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1001 &5430831075364511436 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 5430831075476541849, guid: b8429651427a640919754290f3704312, + type: 3} + propertyPath: m_Name + value: GamepadVis + objectReference: {fileID: 0} + - target: {fileID: 5430831075476541851, guid: b8429651427a640919754290f3704312, + type: 3} + propertyPath: m_LocalPosition.x + value: 955.3655 + objectReference: {fileID: 0} + - target: {fileID: 5430831075476541851, guid: b8429651427a640919754290f3704312, + type: 3} + propertyPath: m_LocalPosition.y + value: 464.9797 + objectReference: {fileID: 0} + - target: {fileID: 5430831075476541851, guid: b8429651427a640919754290f3704312, + type: 3} + propertyPath: m_LocalPosition.z + value: -160.45508 + objectReference: {fileID: 0} + - target: {fileID: 5430831075476541851, guid: b8429651427a640919754290f3704312, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5430831075476541851, guid: b8429651427a640919754290f3704312, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5430831075476541851, guid: b8429651427a640919754290f3704312, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5430831075476541851, guid: b8429651427a640919754290f3704312, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 5430831075476541851, guid: b8429651427a640919754290f3704312, + type: 3} + propertyPath: m_RootOrder + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 5430831075476541851, guid: b8429651427a640919754290f3704312, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5430831075476541851, guid: b8429651427a640919754290f3704312, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 5430831075476541851, guid: b8429651427a640919754290f3704312, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: b8429651427a640919754290f3704312, type: 3} diff --git a/Assets/Samples/VisualizerSamples/GamepadVisualizer.unity.meta b/Assets/Samples/VisualizerSamples/GamepadVisualizer.unity.meta new file mode 100644 index 000000000..9107642c6 --- /dev/null +++ b/Assets/Samples/VisualizerSamples/GamepadVisualizer.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 60155d44a3f544d08a44a9fa0b5e2c4e +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Samples/VisualizerSamples/InputActionVisualizer.cs b/Assets/Samples/VisualizerSamples/InputActionVisualizer.cs new file mode 100644 index 000000000..b282a568c --- /dev/null +++ b/Assets/Samples/VisualizerSamples/InputActionVisualizer.cs @@ -0,0 +1,322 @@ +using System; +using System.Collections.Generic; + +////TODO: support ProcessEventsManually +////TODO: add way to pick by player index + +// Some fields assigned through only through serialization. +#pragma warning disable CS0649 + +namespace UnityEngine.InputSystem.Samples +{ + /// + /// A component for debugging purposes that adds an on-screen display which shows + /// activity on an input action over time () + /// or an action's current value (). + /// + /// + [AddComponentMenu("Input/Debug/Input Action Visualizer")] + [ExecuteInEditMode] + public class InputActionVisualizer : InputVisualizer + { + /// + /// The action that is being visualized. May be null. + /// + public InputAction action => m_Action; + + protected void FixedUpdate() + { + if (m_Visualization != Visualization.Value || m_Action == null || m_Visualizer == null) + return; + if (InputSystem.settings.updateMode != InputSettings.UpdateMode.ProcessEventsInFixedUpdate) + return; + RecordValue(Time.fixedTime); + } + + protected void Update() + { + if (m_Visualization != Visualization.Value || m_Action == null || m_Visualizer == null) + return; + if (InputSystem.settings.updateMode != InputSettings.UpdateMode.ProcessEventsInDynamicUpdate) + return; + RecordValue(Time.time); + } + + protected new void OnEnable() + { + if (m_Visualization == Visualization.None) + return; + + base.OnEnable(); + + ResolveAction(); + SetupVisualizer(); + + if (s_EnabledInstances == null) + s_EnabledInstances = new List(); + if (s_EnabledInstances.Count == 0) + InputSystem.onActionChange += OnActionChange; + s_EnabledInstances.Add(this); + } + + protected new void OnDisable() + { + base.OnDisable(); + + s_EnabledInstances.Remove(this); + if (s_EnabledInstances.Count == 0) + InputSystem.onActionChange -= OnActionChange; + + if (m_Visualization == Visualization.Interaction && m_Action != null) + { + m_Action.started -= OnActionTriggered; + m_Action.performed -= OnActionTriggered; + m_Action.canceled -= OnActionTriggered; + } + } + + protected new void OnGUI() + { + if (m_Visualization == Visualization.None) + return; + + if (Event.current.type != EventType.Repaint) + return; + + base.OnGUI(); + + if (m_ShowControlName && m_ActiveControlName != null) + VisualizationHelpers.DrawText(m_ActiveControlName, new Vector2(m_Rect.x, m_Rect.yMax), + VisualizationHelpers.ValueTextStyle); + } + + private void RecordValue(double time) + { + Debug.Assert(m_Action != null); + Debug.Assert(m_Visualizer != null); + + var value = m_Action.ReadValueAsObject(); + m_Visualizer.AddSample(value, time); + + if (m_ShowControlName) + RecordControlName(); + } + + private void RecordControlName() + { + var control = m_Action.activeControl; + if (control == m_ActiveControl) + return; + + m_ActiveControl = control; + m_ActiveControlName = control != null ? new GUIContent(control.path) : null; + } + + private void ResolveAction() + { + // If we have a reference to an action, try that first. + if (m_ActionReference != null) + m_Action = m_ActionReference.action; + + // If we didn't get an action from that but we have an action name, + // just search through the currently enabled actions for one that + // matches by name. + if (m_Action == null && !string.IsNullOrEmpty(m_ActionName)) + { + var slashIndex = m_ActionName.IndexOf('/'); + var mapName = slashIndex != -1 ? m_ActionName.Substring(0, slashIndex) : null; + var actionName = slashIndex != -1 ? m_ActionName.Substring(slashIndex + 1) : m_ActionName; + + var enabledActions = InputSystem.ListEnabledActions(); + foreach (var action in enabledActions) + { + if (string.Compare(actionName, action.name, StringComparison.InvariantCultureIgnoreCase) != 0) + continue; + + if (mapName != null && action.actionMap != null && string.Compare(mapName, action.actionMap.name, + StringComparison.InvariantCultureIgnoreCase) != 0) + continue; + + m_Action = action; + break; + } + } + + // If we still don't have an action, there's nothing much for us to do. + // The action may show up at a later point. + if (m_Action == null) + return; + + if (m_Visualization == Visualization.Interaction) + { + m_Action.performed += OnActionTriggered; + m_Action.started += OnActionTriggered; + m_Action.canceled += OnActionTriggered; + } + } + + private void SetupVisualizer() + { + m_Visualizer = null; + if (m_Action == null) + return; + + switch (m_Visualization) + { + case Visualization.Value: + switch (m_Action.type) + { + case InputActionType.Button: + m_Visualizer = new VisualizationHelpers.ScalarVisualizer + { + limitMax = 1 + }; + break; + + case InputActionType.Value: + case InputActionType.PassThrough: + if (!string.IsNullOrEmpty(m_Action.expectedControlType)) + { + var layout = InputSystem.LoadLayout(m_Action.expectedControlType); + if (layout != null) + { + var valueType = layout.GetValueType(); + if (valueType == typeof(float)) + m_Visualizer = new VisualizationHelpers.ScalarVisualizer + { + limitMax = 1 + }; + else if (valueType == typeof(int)) + m_Visualizer = new VisualizationHelpers.ScalarVisualizer + { + limitMax = 1 + }; + else if (valueType == typeof(Vector2)) + m_Visualizer = new VisualizationHelpers.Vector2Visualizer(); + } + } + break; + } + break; + + case Visualization.Interaction: + // We don't really know which interactions are sitting on the action and its bindings + // and while we could do and perform work to find out, it's simpler to just wait until + // we get input and then whatever interactions we encounter as we go along. Also keeps + // the visualization a little less cluttered. + m_Visualizer = new VisualizationHelpers.TimelineVisualizer(); + break; + } + } + + private void OnActionDisabled() + { + } + + private void OnActionTriggered(InputAction.CallbackContext context) + { + Debug.Assert(m_Visualization == Visualization.Interaction); + + var timelineName = "Default"; + var interaction = context.interaction; + if (interaction != null) + { + timelineName = interaction.GetType().Name; + if (timelineName.EndsWith("Interaction")) + timelineName = timelineName.Substring(0, timelineName.Length - "Interaction".Length); + } + + var visualizer = (VisualizationHelpers.TimelineVisualizer)m_Visualizer; + var timelineIndex = visualizer.GetTimeline(timelineName); + if (timelineIndex == -1) + { + Color color; + timelineIndex = visualizer.timelineCount; + if (timelineIndex < s_InteractionColors.Length) + color = s_InteractionColors[timelineIndex]; + else + color = new Color(Random.value, Random.value, Random.value, 1); + + visualizer.AddTimeline(timelineName, color); + if (timelineIndex > 0) + visualizer.showLegend = true; + } + + var time = (float)context.time; + switch (context.phase) + { + case InputActionPhase.Canceled: + visualizer.AddSample(timelineIndex, 0f, time); + break; + + case InputActionPhase.Performed: + visualizer.AddSample(timelineIndex, 1f, time); + visualizer.AddSample(timelineIndex, 0f, time); + break; + + case InputActionPhase.Started: + visualizer.AddSample(timelineIndex, 0.5f, time); + break; + } + + if (m_ShowControlName) + RecordControlName(); + } + + private static void OnActionChange(object actionOrMap, InputActionChange change) + { + switch (change) + { + case InputActionChange.ActionEnabled: + case InputActionChange.ActionMapEnabled: + for (var i = 0; i < s_EnabledInstances.Count; ++i) + if (s_EnabledInstances[i].m_Action == null) + { + s_EnabledInstances[i].ResolveAction(); + if (s_EnabledInstances[i].m_Action != null) + s_EnabledInstances[i].SetupVisualizer(); + } + break; + + case InputActionChange.ActionDisabled: + for (var i = 0; i < s_EnabledInstances.Count; ++i) + if (actionOrMap == s_EnabledInstances[i].m_Action) + s_EnabledInstances[i].OnActionDisabled(); + break; + + case InputActionChange.ActionMapDisabled: + for (var i = 0; i < s_EnabledInstances.Count; ++i) + if (s_EnabledInstances[i].m_Action?.actionMap == actionOrMap) + s_EnabledInstances[i].OnActionDisabled(); + break; + } + } + + [SerializeField] private Visualization m_Visualization; + [SerializeField] private InputActionReference m_ActionReference; + [SerializeField] private string m_ActionName; + [SerializeField] private bool m_ShowControlName; + + [NonSerialized] private InputAction m_Action; + [NonSerialized] private InputControl m_ActiveControl; + [NonSerialized] private GUIContent m_ActiveControlName; + + private static List s_EnabledInstances; + private static readonly Color[] s_InteractionColors = + { + new Color(1, 0, 0, 1), + new Color(0, 0, 1, 1), + new Color(1, 1, 0, 1), + new Color(1, 0, 1, 1), + new Color(0, 1, 1, 1), + new Color(0, 1, 0, 1), + }; + + public enum Visualization + { + None, + Value, + Interaction, + } + } +} diff --git a/Assets/Samples/VisualizerSamples/InputActionVisualizer.cs.meta b/Assets/Samples/VisualizerSamples/InputActionVisualizer.cs.meta new file mode 100644 index 000000000..f7d164e85 --- /dev/null +++ b/Assets/Samples/VisualizerSamples/InputActionVisualizer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 939ce9f3839b54466af594f7854ed222 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Samples/VisualizerSamples/InputControlVisualizer.cs b/Assets/Samples/VisualizerSamples/InputControlVisualizer.cs new file mode 100644 index 000000000..0895cac7b --- /dev/null +++ b/Assets/Samples/VisualizerSamples/InputControlVisualizer.cs @@ -0,0 +1,359 @@ +using System; +using System.Collections.Generic; +using UnityEngine.InputSystem.Layouts; +using UnityEngine.InputSystem.LowLevel; + +////TODO: add way to plot values over time + +// Goal is to build this out into something that can visualize a large number of +// aspects about an InputControl/InputDevice especially with an eye towards making +// it a good deal to debug any input collection/processing irregularities that may +// be seen in players (or the editor, for that matter). + +// Some fields assigned through only through serialization. +#pragma warning disable CS0649 + +namespace UnityEngine.InputSystem.Samples +{ + /// + /// A component for debugging purposes that adds an on-screen display which shows + /// activity on an input control over time. + /// + /// + /// This component is most useful for debugging input directly on the source device. + /// + /// + [AddComponentMenu("Input/Debug/Input Control Visualizer")] + [ExecuteInEditMode] + public class InputControlVisualizer : InputVisualizer + { + /// + /// What kind of visualization to show. + /// + public Mode visualization + { + get => m_Visualization; + set + { + if (m_Visualization == value) + return; + m_Visualization = value; + SetupVisualizer(); + } + } + + /// + /// Path of the control that is to be visualized. + /// + /// + /// + public string controlPath + { + get => m_ControlPath; + set + { + m_ControlPath = value; + if (m_Control != null) + ResolveControl(); + } + } + + /// + /// If, at runtime, multiple controls are matching , this property + /// determines the index of the control that is retrieved from the possible options. + /// + public int controlIndex + { + get => m_ControlIndex; + set + { + m_ControlIndex = value; + if (m_Control != null) + ResolveControl(); + } + } + + /// + /// The control resolved from at runtime. May be null. + /// + public InputControl control => m_Control; + + protected new void OnEnable() + { + if (m_Visualization == Mode.None) + return; + + if (s_EnabledInstances == null) + s_EnabledInstances = new List(); + if (s_EnabledInstances.Count == 0) + { + InputSystem.onDeviceChange += OnDeviceChange; + InputSystem.onEvent += OnEvent; + } + s_EnabledInstances.Add(this); + + ResolveControl(); + + base.OnEnable(); + } + + protected new void OnDisable() + { + if (m_Visualization == Mode.None) + return; + + s_EnabledInstances.Remove(this); + if (s_EnabledInstances.Count == 0) + { + InputSystem.onDeviceChange -= OnDeviceChange; + InputSystem.onEvent -= OnEvent; + } + + m_Control = null; + + base.OnDisable(); + } + + protected new void OnGUI() + { + if (m_Visualization == Mode.None) + return; + + base.OnGUI(); + } + + protected new void OnValidate() + { + ResolveControl(); + base.OnValidate(); + } + + [Tooltip("The type of visualization to perform for the control.")] + [SerializeField] private Mode m_Visualization; + [Tooltip("Path of the control that should be visualized. If at runtime, multiple " + + "controls match the given path, the 'Control Index' property can be used to decide " + + "which of the controls to visualize.")] + [InputControl, SerializeField] private string m_ControlPath; + [Tooltip("If multiple controls match 'Control Path' at runtime, this property decides " + + "which control to visualize from the list of candidates. It is a zero-based index.")] + [SerializeField] private int m_ControlIndex; + + [NonSerialized] private InputControl m_Control; + + private static List s_EnabledInstances; + + private void ResolveControl() + { + m_Control = null; + if (string.IsNullOrEmpty(m_ControlPath)) + return; + + using (var candidates = InputSystem.FindControls(m_ControlPath)) + { + var numCandidates = candidates.Count; + if (numCandidates > 1 && m_ControlIndex < numCandidates && m_ControlIndex >= 0) + m_Control = candidates[m_ControlIndex]; + else if (numCandidates > 0) + m_Control = candidates[0]; + } + + SetupVisualizer(); + } + + private void SetupVisualizer() + { + if (m_Control == null) + { + m_Visualizer = null; + return; + } + + switch (m_Visualization) + { + case Mode.Value: + { + var valueType = m_Control.valueType; + if (valueType == typeof(Vector2)) + m_Visualizer = new VisualizationHelpers.Vector2Visualizer(m_HistorySamples); + else if (valueType == typeof(float)) + m_Visualizer = new VisualizationHelpers.ScalarVisualizer(m_HistorySamples) + { + ////TODO: pass actual min/max limits of control + limitMax = 1, + limitMin = 0 + }; + else if (valueType == typeof(int)) + m_Visualizer = new VisualizationHelpers.ScalarVisualizer(m_HistorySamples) + { + ////TODO: pass actual min/max limits of control + limitMax = 1, + limitMin = 0 + }; + else + { + ////TODO: generic visualizer + } + break; + } + + case Mode.Events: + { + var visualizer = new VisualizationHelpers.TimelineVisualizer(m_HistorySamples) + { + timeUnit = VisualizationHelpers.TimelineVisualizer.TimeUnit.Frames, + historyDepth = m_HistorySamples, + showLimits = true, + limitsY = new Vector2(0, 5) // Will expand upward automatically + }; + m_Visualizer = visualizer; + visualizer.AddTimeline("Events", Color.green, + VisualizationHelpers.TimelineVisualizer.PlotType.BarChart); + break; + } + + case Mode.MaximumLag: + { + var visualizer = new VisualizationHelpers.TimelineVisualizer(m_HistorySamples) + { + timeUnit = VisualizationHelpers.TimelineVisualizer.TimeUnit.Frames, + historyDepth = m_HistorySamples, + valueUnit = new GUIContent("ms"), + showLimits = true, + limitsY = new Vector2(0, 6) + }; + m_Visualizer = visualizer; + visualizer.AddTimeline("MaxLag", Color.red, + VisualizationHelpers.TimelineVisualizer.PlotType.BarChart); + break; + } + + case Mode.Bytes: + { + var visualizer = new VisualizationHelpers.TimelineVisualizer(m_HistorySamples) + { + timeUnit = VisualizationHelpers.TimelineVisualizer.TimeUnit.Frames, + valueUnit = new GUIContent("bytes"), + historyDepth = m_HistorySamples, + showLimits = true, + limitsY = new Vector2(0, 64) + }; + m_Visualizer = visualizer; + visualizer.AddTimeline("Bytes", Color.red, + VisualizationHelpers.TimelineVisualizer.PlotType.BarChart); + break; + } + + default: + throw new NotImplementedException(); + } + } + + private static void OnDeviceChange(InputDevice device, InputDeviceChange change) + { + if (change != InputDeviceChange.Added && change != InputDeviceChange.Removed) + return; + + for (var i = 0; i < s_EnabledInstances.Count; ++i) + { + var component = s_EnabledInstances[i]; + if (change == InputDeviceChange.Removed && component.m_Control != null && + component.m_Control.device == device) + component.ResolveControl(); + else if (change == InputDeviceChange.Added) + component.ResolveControl(); + } + } + + private static void OnEvent(InputEventPtr eventPtr, InputDevice device) + { + // Ignore very first update as we usually get huge lag spikes and event count + // spikes in it from stuff that has accumulated while going into play mode or + // starting up the player. + if (InputState.updateCount <= 1) + return; + + if (InputState.currentUpdateType == InputUpdateType.Editor) + return; + + if (!eventPtr.IsA() && !eventPtr.IsA()) + return; + + for (var i = 0; i < s_EnabledInstances.Count; ++i) + { + var component = s_EnabledInstances[i]; + if (component.m_Control.device != device || component.m_Visualizer == null) + continue; + + component.OnEventImpl(eventPtr); + } + } + + private unsafe void OnEventImpl(InputEventPtr eventPtr) + { + switch (m_Visualization) + { + case Mode.Value: + { + var statePtr = m_Control.GetStatePtrFromStateEvent(eventPtr); + if (statePtr == null) + return; // No value for control in event. + var value = m_Control.ReadValueFromStateAsObject(statePtr); + m_Visualizer.AddSample(value, eventPtr.time); + break; + } + + case Mode.Events: + { + var visualizer = (VisualizationHelpers.TimelineVisualizer)m_Visualizer; + var frame = (int)InputState.updateCount; + ref var valueRef = ref visualizer.GetOrCreateSample(0, frame); + var value = valueRef.ToInt32() + 1; + valueRef = value; + visualizer.limitsY = + new Vector2(0, Mathf.Max(value, visualizer.limitsY.y)); + break; + } + + case Mode.MaximumLag: + { + var visualizer = (VisualizationHelpers.TimelineVisualizer)m_Visualizer; + var lag = (Time.realtimeSinceStartup - eventPtr.time) * 1000; // In milliseconds. + var frame = (int)InputState.updateCount; + ref var valueRef = ref visualizer.GetOrCreateSample(0, frame); + + if (lag > valueRef.ToDouble()) + { + valueRef = lag; + if (lag > visualizer.limitsY.y) + visualizer.limitsY = new Vector2(0, Mathf.Ceil((float)lag)); + } + break; + } + + case Mode.Bytes: + { + var visualizer = (VisualizationHelpers.TimelineVisualizer)m_Visualizer; + var frame = (int)InputState.updateCount; + ref var valueRef = ref visualizer.GetOrCreateSample(0, frame); + var value = valueRef.ToInt32() + eventPtr.sizeInBytes; + valueRef = value; + visualizer.limitsY = + new Vector2(0, Mathf.Max(value, visualizer.limitsY.y)); + break; + } + } + } + + /// + /// Determines which aspect of the control should be visualized. + /// + public enum Mode + { + None = 0, + Value = 1, + Events = 4, + MaximumLag = 6, + Bytes = 7, + } + } +} diff --git a/Assets/Samples/VisualizerSamples/InputControlVisualizer.cs.meta b/Assets/Samples/VisualizerSamples/InputControlVisualizer.cs.meta new file mode 100644 index 000000000..b0ac5e6f1 --- /dev/null +++ b/Assets/Samples/VisualizerSamples/InputControlVisualizer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 50c7363fac4d24ae8a679e3e8f1fa838 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Samples/VisualizerSamples/InputVisualizer.cs b/Assets/Samples/VisualizerSamples/InputVisualizer.cs new file mode 100644 index 000000000..46aaf5c7b --- /dev/null +++ b/Assets/Samples/VisualizerSamples/InputVisualizer.cs @@ -0,0 +1,80 @@ +using System; + +namespace UnityEngine.InputSystem.Samples +{ + /// + /// Base class for and . + /// Not meant to be extended outside of input system. + /// + public abstract class InputVisualizer : MonoBehaviour + { + protected void OnEnable() + { + ResolveParent(); + } + + protected void OnDisable() + { + m_Parent = null; + m_Visualizer = null; + } + + protected void OnGUI() + { + if (Event.current.type != EventType.Repaint) + return; + + // If we have a parent, offset our rect by the parent. + var rect = m_Rect; + if (m_Parent != null) + rect.position += m_Parent.m_Rect.position; + + if (m_Visualizer != null) + m_Visualizer.OnDraw(rect); + else + VisualizationHelpers.DrawRectangle(rect, new Color(1, 1, 1, 0.1f)); + + // Draw label, if we have one. + if (!string.IsNullOrEmpty(m_Label)) + { + if (m_LabelContent == null) + m_LabelContent = new GUIContent(m_Label); + if (s_LabelStyle == null) + { + s_LabelStyle = new GUIStyle(); + s_LabelStyle.normal.textColor = Color.yellow; + } + + ////FIXME: why does CalcSize not calculate the rect width correctly? + var labelSize = s_LabelStyle.CalcSize(m_LabelContent); + var labelRect = new Rect(rect.x + 4, rect.y, labelSize.x + 4, rect.height); + + s_LabelStyle.Draw(labelRect, m_LabelContent, false, false, false, false); + } + } + + protected void OnValidate() + { + ResolveParent(); + m_LabelContent = null; + } + + protected void ResolveParent() + { + var parentTransform = transform.parent; + if (parentTransform != null) + m_Parent = parentTransform.GetComponent(); + } + + [SerializeField] internal string m_Label; + [SerializeField] internal int m_HistorySamples = 500; + [SerializeField] internal float m_TimeWindow = 3; + [SerializeField] internal Rect m_Rect = new Rect(10, 10, 300, 30); + + [NonSerialized] internal GUIContent m_LabelContent; + [NonSerialized] internal VisualizationHelpers.Visualizer m_Visualizer; + [NonSerialized] internal InputVisualizer m_Parent; + + private static GUIStyle s_LabelStyle; + } +} diff --git a/Assets/Samples/VisualizerSamples/InputVisualizer.cs.meta b/Assets/Samples/VisualizerSamples/InputVisualizer.cs.meta new file mode 100644 index 000000000..1101cdf38 --- /dev/null +++ b/Assets/Samples/VisualizerSamples/InputVisualizer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 55e8b429cfd654e2f89f16b18d99cf4b +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Samples/VisualizerSamples/MouseVis.prefab b/Assets/Samples/VisualizerSamples/MouseVis.prefab new file mode 100644 index 000000000..1c01dd766 --- /dev/null +++ b/Assets/Samples/VisualizerSamples/MouseVis.prefab @@ -0,0 +1,561 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &1425893226964488728 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 8404550706546444740} + - component: {fileID: 9057694317555835649} + m_Layer: 0 + m_Name: Scroll + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &8404550706546444740 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1425893226964488728} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -955.3655, y: -464.9797, z: 160.45508} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 2680667830796240931} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &9057694317555835649 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1425893226964488728} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 50c7363fac4d24ae8a679e3e8f1fa838, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Label: Scroll + m_HistorySamples: 100 + m_TimeWindow: 3 + m_Rect: + serializedVersion: 2 + x: 350 + y: 0 + width: 150 + height: 150 + m_Visualization: 1 + m_ControlPath: /scroll + m_ControlIndex: 0 +--- !u!1 &2680667828813364402 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2680667828813364403} + - component: {fileID: 2680667828813364412} + m_Layer: 0 + m_Name: MMB + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2680667828813364403 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2680667828813364402} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -955.3655, y: -464.9797, z: 160.45508} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 2680667830796240931} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &2680667828813364412 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2680667828813364402} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 50c7363fac4d24ae8a679e3e8f1fa838, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Label: MMB + m_HistorySamples: 100 + m_TimeWindow: 3 + m_Rect: + serializedVersion: 2 + x: 85 + y: 175 + width: 50 + height: 50 + m_Visualization: 1 + m_ControlPath: /middleButton + m_ControlIndex: 0 +--- !u!1 &2680667828976453752 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2680667828976453753} + - component: {fileID: 2680667828976453754} + m_Layer: 0 + m_Name: LMB + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2680667828976453753 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2680667828976453752} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -955.3655, y: -464.9797, z: 160.45508} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 2680667830796240931} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &2680667828976453754 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2680667828976453752} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 50c7363fac4d24ae8a679e3e8f1fa838, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Label: LMB + m_HistorySamples: 100 + m_TimeWindow: 3 + m_Rect: + serializedVersion: 2 + x: 25 + y: 175 + width: 50 + height: 50 + m_Visualization: 1 + m_ControlPath: /leftButton + m_ControlIndex: 0 +--- !u!1 &2680667828982178413 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2680667828982178415} + - component: {fileID: 2680667828982178414} + m_Layer: 0 + m_Name: Events + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2680667828982178415 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2680667828982178413} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 2680667830796240931} + m_RootOrder: 6 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &2680667828982178414 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2680667828982178413} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 50c7363fac4d24ae8a679e3e8f1fa838, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Label: Events + m_HistorySamples: 500 + m_TimeWindow: 3 + m_Rect: + serializedVersion: 2 + x: 20 + y: 375 + width: 700 + height: 70 + m_Visualization: 4 + m_ControlPath: + m_ControlIndex: 0 +--- !u!1 &2680667830654736508 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2680667830654736509} + - component: {fileID: 2680667830654736510} + m_Layer: 0 + m_Name: Lag + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2680667830654736509 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2680667830654736508} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 2680667830796240931} + m_RootOrder: 7 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &2680667830654736510 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2680667830654736508} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 50c7363fac4d24ae8a679e3e8f1fa838, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Label: Lag (ms) + m_HistorySamples: 500 + m_TimeWindow: 3 + m_Rect: + serializedVersion: 2 + x: 20 + y: 460 + width: 700 + height: 70 + m_Visualization: 6 + m_ControlPath: + m_ControlIndex: 0 +--- !u!1 &2680667830751945958 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2680667830751945952} + - component: {fileID: 2680667830751945959} + m_Layer: 0 + m_Name: Position + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2680667830751945952 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2680667830751945958} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -955.3655, y: -464.9797, z: 160.45508} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 2680667830796240931} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &2680667830751945959 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2680667830751945958} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 50c7363fac4d24ae8a679e3e8f1fa838, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Label: Position + m_HistorySamples: 100 + m_TimeWindow: 3 + m_Rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 150 + height: 150 + m_Visualization: 1 + m_ControlPath: /position + m_ControlIndex: 0 +--- !u!1 &2680667830796240929 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2680667830796240931} + - component: {fileID: 2680667830796240930} + m_Layer: 0 + m_Name: MouseVis + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2680667830796240931 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2680667830796240929} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 955.3655, y: 464.9797, z: -160.45508} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 2680667830751945952} + - {fileID: 2680667830847656253} + - {fileID: 8404550706546444740} + - {fileID: 2680667828976453753} + - {fileID: 2680667828813364403} + - {fileID: 2680667830881149239} + - {fileID: 2680667828982178415} + - {fileID: 2680667830654736509} + - {fileID: 2680667830892693960} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &2680667830796240930 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2680667830796240929} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 50c7363fac4d24ae8a679e3e8f1fa838, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Label: + m_HistorySamples: 500 + m_TimeWindow: 3 + m_Rect: + serializedVersion: 2 + x: 15 + y: 10 + width: 300 + height: 30 + m_Visualization: 0 + m_ControlPath: + m_ControlIndex: 0 +--- !u!1 &2680667830847656252 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2680667830847656253} + - component: {fileID: 2680667830847656254} + m_Layer: 0 + m_Name: Delta + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2680667830847656253 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2680667830847656252} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -955.3655, y: -464.9797, z: 160.45508} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 2680667830796240931} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &2680667830847656254 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2680667830847656252} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 50c7363fac4d24ae8a679e3e8f1fa838, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Label: Delta + m_HistorySamples: 100 + m_TimeWindow: 3 + m_Rect: + serializedVersion: 2 + x: 175 + y: 0 + width: 150 + height: 150 + m_Visualization: 1 + m_ControlPath: /delta + m_ControlIndex: 0 +--- !u!1 &2680667830881149238 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2680667830881149239} + - component: {fileID: 2680667830881149232} + m_Layer: 0 + m_Name: RMB + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2680667830881149239 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2680667830881149238} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -955.3655, y: -464.9797, z: 160.45508} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 2680667830796240931} + m_RootOrder: 5 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &2680667830881149232 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2680667830881149238} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 50c7363fac4d24ae8a679e3e8f1fa838, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Label: RMB + m_HistorySamples: 100 + m_TimeWindow: 3 + m_Rect: + serializedVersion: 2 + x: 145 + y: 175 + width: 50 + height: 50 + m_Visualization: 1 + m_ControlPath: /rightButton + m_ControlIndex: 0 +--- !u!1 &2680667830892693967 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2680667830892693960} + - component: {fileID: 2680667830892693961} + m_Layer: 0 + m_Name: Bytes + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2680667830892693960 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2680667830892693967} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 2680667830796240931} + m_RootOrder: 8 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &2680667830892693961 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2680667830892693967} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 50c7363fac4d24ae8a679e3e8f1fa838, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Label: Bytes + m_HistorySamples: 500 + m_TimeWindow: 3 + m_Rect: + serializedVersion: 2 + x: 20 + y: 550 + width: 700 + height: 70 + m_Visualization: 7 + m_ControlPath: + m_ControlIndex: 0 diff --git a/Assets/Samples/VisualizerSamples/MouseVis.prefab.meta b/Assets/Samples/VisualizerSamples/MouseVis.prefab.meta new file mode 100644 index 000000000..22aa70413 --- /dev/null +++ b/Assets/Samples/VisualizerSamples/MouseVis.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 76c62aa07f01945d4b9afdb34d7a3396 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Samples/VisualizerSamples/MouseVisualizer.unity b/Assets/Samples/VisualizerSamples/MouseVisualizer.unity new file mode 100644 index 000000000..b06bffe97 --- /dev/null +++ b/Assets/Samples/VisualizerSamples/MouseVisualizer.unity @@ -0,0 +1,274 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 11 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 1 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ShowResolutionOverlay: 1 + m_ExportTrainingData: 0 + m_LightingDataAsset: {fileID: 0} + m_UseShadowmask: 1 +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &676010914 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 676010918} + - component: {fileID: 676010917} + - component: {fileID: 676010916} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!81 &676010916 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 676010914} + m_Enabled: 1 +--- !u!20 &676010917 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 676010914} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 2 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_FocalLength: 50 + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 60 + orthographic: 0 + orthographic size: 5 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!4 &676010918 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 676010914} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 1, z: -10} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1001 &2680667830097201012 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 2680667830796240929, guid: 76c62aa07f01945d4b9afdb34d7a3396, + type: 3} + propertyPath: m_Name + value: MouseVis + objectReference: {fileID: 0} + - target: {fileID: 2680667830796240931, guid: 76c62aa07f01945d4b9afdb34d7a3396, + type: 3} + propertyPath: m_LocalPosition.x + value: 955.3655 + objectReference: {fileID: 0} + - target: {fileID: 2680667830796240931, guid: 76c62aa07f01945d4b9afdb34d7a3396, + type: 3} + propertyPath: m_LocalPosition.y + value: 464.9797 + objectReference: {fileID: 0} + - target: {fileID: 2680667830796240931, guid: 76c62aa07f01945d4b9afdb34d7a3396, + type: 3} + propertyPath: m_LocalPosition.z + value: -160.45508 + objectReference: {fileID: 0} + - target: {fileID: 2680667830796240931, guid: 76c62aa07f01945d4b9afdb34d7a3396, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2680667830796240931, guid: 76c62aa07f01945d4b9afdb34d7a3396, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2680667830796240931, guid: 76c62aa07f01945d4b9afdb34d7a3396, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2680667830796240931, guid: 76c62aa07f01945d4b9afdb34d7a3396, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2680667830796240931, guid: 76c62aa07f01945d4b9afdb34d7a3396, + type: 3} + propertyPath: m_RootOrder + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 2680667830796240931, guid: 76c62aa07f01945d4b9afdb34d7a3396, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2680667830796240931, guid: 76c62aa07f01945d4b9afdb34d7a3396, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2680667830796240931, guid: 76c62aa07f01945d4b9afdb34d7a3396, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 76c62aa07f01945d4b9afdb34d7a3396, type: 3} diff --git a/Assets/Samples/VisualizerSamples/MouseVisualizer.unity.meta b/Assets/Samples/VisualizerSamples/MouseVisualizer.unity.meta new file mode 100644 index 000000000..750e96fe9 --- /dev/null +++ b/Assets/Samples/VisualizerSamples/MouseVisualizer.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: fef3f56dbc5ed42a08528b798af41a4e +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Samples/VisualizerSamples/PenVis.prefab b/Assets/Samples/VisualizerSamples/PenVis.prefab new file mode 100644 index 000000000..5031eddbd --- /dev/null +++ b/Assets/Samples/VisualizerSamples/PenVis.prefab @@ -0,0 +1,897 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &3520677240532848139 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3520677240532848138} + - component: {fileID: 3520677240532848141} + m_Layer: 0 + m_Name: Eraser + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3520677240532848138 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3520677240532848139} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -955.3655, y: -464.9797, z: 160.45508} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 3520677241453528550} + m_RootOrder: 10 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &3520677240532848141 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3520677240532848139} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 50c7363fac4d24ae8a679e3e8f1fa838, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Label: Eraser + m_HistorySamples: 100 + m_TimeWindow: 3 + m_Rect: + serializedVersion: 2 + x: 375 + y: 175 + width: 50 + height: 50 + m_Visualization: 1 + m_ControlPath: /eraser + m_ControlIndex: 0 +--- !u!1 &3520677240764781865 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3520677240764781864} + - component: {fileID: 3520677240764781867} + m_Layer: 0 + m_Name: Twist + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3520677240764781864 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3520677240764781865} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -955.3655, y: -464.9797, z: 160.45508} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 3520677241453528550} + m_RootOrder: 5 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &3520677240764781867 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3520677240764781865} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 50c7363fac4d24ae8a679e3e8f1fa838, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Label: Twist + m_HistorySamples: 100 + m_TimeWindow: 3 + m_Rect: + serializedVersion: 2 + x: 250 + y: 250 + width: 150 + height: 50 + m_Visualization: 1 + m_ControlPath: /twist + m_ControlIndex: 0 +--- !u!1 &3520677241026549177 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3520677241026549176} + - component: {fileID: 3520677241026549179} + m_Layer: 0 + m_Name: Lag + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3520677241026549176 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3520677241026549177} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 3520677241453528550} + m_RootOrder: 13 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &3520677241026549179 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3520677241026549177} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 50c7363fac4d24ae8a679e3e8f1fa838, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Label: Lag (ms) + m_HistorySamples: 500 + m_TimeWindow: 3 + m_Rect: + serializedVersion: 2 + x: 20 + y: 460 + width: 700 + height: 70 + m_Visualization: 6 + m_ControlPath: + m_ControlIndex: 0 +--- !u!1 &3520677241337048307 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3520677241337048306} + - component: {fileID: 3520677241337048309} + m_Layer: 0 + m_Name: Barrel2 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3520677241337048306 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3520677241337048307} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -955.3655, y: -464.9797, z: 160.45508} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 3520677241453528550} + m_RootOrder: 7 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &3520677241337048309 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3520677241337048307} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 50c7363fac4d24ae8a679e3e8f1fa838, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Label: 2nd + m_HistorySamples: 100 + m_TimeWindow: 3 + m_Rect: + serializedVersion: 2 + x: 145 + y: 175 + width: 50 + height: 50 + m_Visualization: 1 + m_ControlPath: /barrel2 + m_ControlIndex: 0 +--- !u!1 &3520677241357042698 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3520677241357042701} + - component: {fileID: 3520677241357042700} + m_Layer: 0 + m_Name: Bytes + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3520677241357042701 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3520677241357042698} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 3520677241453528550} + m_RootOrder: 14 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &3520677241357042700 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3520677241357042698} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 50c7363fac4d24ae8a679e3e8f1fa838, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Label: Bytes + m_HistorySamples: 500 + m_TimeWindow: 3 + m_Rect: + serializedVersion: 2 + x: 20 + y: 550 + width: 700 + height: 70 + m_Visualization: 7 + m_ControlPath: + m_ControlIndex: 0 +--- !u!1 &3520677241370664185 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3520677241370664184} + - component: {fileID: 3520677241370664187} + m_Layer: 0 + m_Name: Delta + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3520677241370664184 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3520677241370664185} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -955.3655, y: -464.9797, z: 160.45508} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 3520677241453528550} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &3520677241370664187 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3520677241370664185} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 50c7363fac4d24ae8a679e3e8f1fa838, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Label: Delta + m_HistorySamples: 100 + m_TimeWindow: 3 + m_Rect: + serializedVersion: 2 + x: 175 + y: 0 + width: 150 + height: 150 + m_Visualization: 1 + m_ControlPath: /delta + m_ControlIndex: 0 +--- !u!1 &3520677241453528548 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3520677241453528550} + - component: {fileID: 3520677241453528551} + m_Layer: 0 + m_Name: PenVis + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3520677241453528550 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3520677241453528548} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 955.3655, y: 464.9797, z: -160.45508} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 3520677241460091173} + - {fileID: 3520677241370664184} + - {fileID: 3520677241761661964} + - {fileID: 3520677241631212988} + - {fileID: 3520677241919970684} + - {fileID: 3520677240764781864} + - {fileID: 3520677241827783030} + - {fileID: 3520677241337048306} + - {fileID: 3520677242431053811} + - {fileID: 3520677242357097670} + - {fileID: 3520677240532848138} + - {fileID: 3520677242061452019} + - {fileID: 3520677241652670378} + - {fileID: 3520677241026549176} + - {fileID: 3520677241357042701} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &3520677241453528551 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3520677241453528548} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 50c7363fac4d24ae8a679e3e8f1fa838, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Label: + m_HistorySamples: 500 + m_TimeWindow: 3 + m_Rect: + serializedVersion: 2 + x: 15 + y: 10 + width: 300 + height: 30 + m_Visualization: 0 + m_ControlPath: + m_ControlIndex: 0 +--- !u!1 &3520677241460091171 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3520677241460091173} + - component: {fileID: 3520677241460091170} + m_Layer: 0 + m_Name: Position + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3520677241460091173 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3520677241460091171} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -955.3655, y: -464.9797, z: 160.45508} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 3520677241453528550} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &3520677241460091170 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3520677241460091171} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 50c7363fac4d24ae8a679e3e8f1fa838, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Label: Position + m_HistorySamples: 100 + m_TimeWindow: 3 + m_Rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 150 + height: 150 + m_Visualization: 1 + m_ControlPath: /position + m_ControlIndex: 0 +--- !u!1 &3520677241631212989 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3520677241631212988} + - component: {fileID: 3520677241631212991} + m_Layer: 0 + m_Name: Tip + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3520677241631212988 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3520677241631212989} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -955.3655, y: -464.9797, z: 160.45508} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 3520677241453528550} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &3520677241631212991 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3520677241631212989} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 50c7363fac4d24ae8a679e3e8f1fa838, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Label: Tip + m_HistorySamples: 100 + m_TimeWindow: 3 + m_Rect: + serializedVersion: 2 + x: 25 + y: 175 + width: 50 + height: 50 + m_Visualization: 1 + m_ControlPath: /tip + m_ControlIndex: 0 +--- !u!1 &3520677241652670376 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3520677241652670378} + - component: {fileID: 3520677241652670379} + m_Layer: 0 + m_Name: Events + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3520677241652670378 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3520677241652670376} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 3520677241453528550} + m_RootOrder: 12 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &3520677241652670379 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3520677241652670376} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 50c7363fac4d24ae8a679e3e8f1fa838, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Label: Events + m_HistorySamples: 500 + m_TimeWindow: 3 + m_Rect: + serializedVersion: 2 + x: 20 + y: 375 + width: 700 + height: 70 + m_Visualization: 4 + m_ControlPath: + m_ControlIndex: 0 +--- !u!1 &3520677241761661965 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3520677241761661964} + - component: {fileID: 3520677241761661967} + m_Layer: 0 + m_Name: Tilt + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3520677241761661964 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3520677241761661965} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -955.3655, y: -464.9797, z: 160.45508} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 3520677241453528550} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &3520677241761661967 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3520677241761661965} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 50c7363fac4d24ae8a679e3e8f1fa838, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Label: Tilt + m_HistorySamples: 100 + m_TimeWindow: 3 + m_Rect: + serializedVersion: 2 + x: 350 + y: 0 + width: 150 + height: 150 + m_Visualization: 1 + m_ControlPath: /tilt + m_ControlIndex: 0 +--- !u!1 &3520677241827783031 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3520677241827783030} + - component: {fileID: 3520677241827783033} + m_Layer: 0 + m_Name: Barrel1 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3520677241827783030 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3520677241827783031} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -955.3655, y: -464.9797, z: 160.45508} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 3520677241453528550} + m_RootOrder: 6 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &3520677241827783033 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3520677241827783031} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 50c7363fac4d24ae8a679e3e8f1fa838, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Label: 1st + m_HistorySamples: 100 + m_TimeWindow: 3 + m_Rect: + serializedVersion: 2 + x: 85 + y: 175 + width: 50 + height: 50 + m_Visualization: 1 + m_ControlPath: /barrel1 + m_ControlIndex: 0 +--- !u!1 &3520677241919970685 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3520677241919970684} + - component: {fileID: 3520677241919970687} + m_Layer: 0 + m_Name: Pressure + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3520677241919970684 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3520677241919970685} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -955.3655, y: -464.9797, z: 160.45508} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 3520677241453528550} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &3520677241919970687 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3520677241919970685} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 50c7363fac4d24ae8a679e3e8f1fa838, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Label: Pressure + m_HistorySamples: 100 + m_TimeWindow: 3 + m_Rect: + serializedVersion: 2 + x: 25 + y: 250 + width: 200 + height: 50 + m_Visualization: 1 + m_ControlPath: /pressure + m_ControlIndex: 0 +--- !u!1 &3520677242061452016 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3520677242061452019} + - component: {fileID: 3520677242061452018} + m_Layer: 0 + m_Name: InRange + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3520677242061452019 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3520677242061452016} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -955.3655, y: -464.9797, z: 160.45508} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 3520677241453528550} + m_RootOrder: 11 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &3520677242061452018 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3520677242061452016} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 50c7363fac4d24ae8a679e3e8f1fa838, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Label: InRange + m_HistorySamples: 100 + m_TimeWindow: 3 + m_Rect: + serializedVersion: 2 + x: 435 + y: 175 + width: 50 + height: 50 + m_Visualization: 1 + m_ControlPath: /inRange + m_ControlIndex: 0 +--- !u!1 &3520677242357097671 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3520677242357097670} + - component: {fileID: 3520677242357097673} + m_Layer: 0 + m_Name: Barrel4 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3520677242357097670 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3520677242357097671} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -955.3655, y: -464.9797, z: 160.45508} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 3520677241453528550} + m_RootOrder: 9 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &3520677242357097673 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3520677242357097671} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 50c7363fac4d24ae8a679e3e8f1fa838, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Label: 4th + m_HistorySamples: 100 + m_TimeWindow: 3 + m_Rect: + serializedVersion: 2 + x: 265 + y: 175 + width: 50 + height: 50 + m_Visualization: 1 + m_ControlPath: /barrel4 + m_ControlIndex: 0 +--- !u!1 &3520677242431053808 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3520677242431053811} + - component: {fileID: 3520677242431053810} + m_Layer: 0 + m_Name: Barrel3 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &3520677242431053811 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3520677242431053808} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: -955.3655, y: -464.9797, z: 160.45508} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 3520677241453528550} + m_RootOrder: 8 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &3520677242431053810 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3520677242431053808} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 50c7363fac4d24ae8a679e3e8f1fa838, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Label: 3rd + m_HistorySamples: 100 + m_TimeWindow: 3 + m_Rect: + serializedVersion: 2 + x: 205 + y: 175 + width: 50 + height: 50 + m_Visualization: 1 + m_ControlPath: /barrel3 + m_ControlIndex: 0 diff --git a/Assets/Samples/VisualizerSamples/PenVis.prefab.meta b/Assets/Samples/VisualizerSamples/PenVis.prefab.meta new file mode 100644 index 000000000..91c17f4b0 --- /dev/null +++ b/Assets/Samples/VisualizerSamples/PenVis.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 15e76881a88c849388ecd62eb8a05750 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Samples/VisualizerSamples/PenVisualizer.unity b/Assets/Samples/VisualizerSamples/PenVisualizer.unity new file mode 100644 index 000000000..1ab0ef16f --- /dev/null +++ b/Assets/Samples/VisualizerSamples/PenVisualizer.unity @@ -0,0 +1,274 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 11 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 1 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ShowResolutionOverlay: 1 + m_ExportTrainingData: 0 + m_LightingDataAsset: {fileID: 0} + m_UseShadowmask: 1 +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &676010914 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 676010918} + - component: {fileID: 676010917} + - component: {fileID: 676010916} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!81 &676010916 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 676010914} + m_Enabled: 1 +--- !u!20 &676010917 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 676010914} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 2 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_FocalLength: 50 + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 60 + orthographic: 0 + orthographic size: 5 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!4 &676010918 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 676010914} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 1, z: -10} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1001 &3520677240537631409 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 3520677241453528548, guid: 15e76881a88c849388ecd62eb8a05750, + type: 3} + propertyPath: m_Name + value: PenVis + objectReference: {fileID: 0} + - target: {fileID: 3520677241453528550, guid: 15e76881a88c849388ecd62eb8a05750, + type: 3} + propertyPath: m_LocalPosition.x + value: 955.3655 + objectReference: {fileID: 0} + - target: {fileID: 3520677241453528550, guid: 15e76881a88c849388ecd62eb8a05750, + type: 3} + propertyPath: m_LocalPosition.y + value: 464.9797 + objectReference: {fileID: 0} + - target: {fileID: 3520677241453528550, guid: 15e76881a88c849388ecd62eb8a05750, + type: 3} + propertyPath: m_LocalPosition.z + value: -160.45508 + objectReference: {fileID: 0} + - target: {fileID: 3520677241453528550, guid: 15e76881a88c849388ecd62eb8a05750, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3520677241453528550, guid: 15e76881a88c849388ecd62eb8a05750, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3520677241453528550, guid: 15e76881a88c849388ecd62eb8a05750, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3520677241453528550, guid: 15e76881a88c849388ecd62eb8a05750, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 3520677241453528550, guid: 15e76881a88c849388ecd62eb8a05750, + type: 3} + propertyPath: m_RootOrder + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 3520677241453528550, guid: 15e76881a88c849388ecd62eb8a05750, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3520677241453528550, guid: 15e76881a88c849388ecd62eb8a05750, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 3520677241453528550, guid: 15e76881a88c849388ecd62eb8a05750, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 15e76881a88c849388ecd62eb8a05750, type: 3} diff --git a/Assets/Samples/VisualizerSamples/PenVisualizer.unity.meta b/Assets/Samples/VisualizerSamples/PenVisualizer.unity.meta new file mode 100644 index 000000000..e0802556f --- /dev/null +++ b/Assets/Samples/VisualizerSamples/PenVisualizer.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: e35258e8d9ecf4a17b799d42b5ace6f3 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Samples/VisualizerSamples/SimpleControls.inputactions b/Assets/Samples/VisualizerSamples/SimpleControls.inputactions new file mode 100644 index 000000000..db7764d26 --- /dev/null +++ b/Assets/Samples/VisualizerSamples/SimpleControls.inputactions @@ -0,0 +1,170 @@ +{ + "name": "SimpleControls", + "maps": [ + { + "name": "gameplay", + "id": "265c38f5-dd18-4d34-b198-aec58e1627ff", + "actions": [ + { + "name": "fire", + "type": "Button", + "id": "1077f913-a9f9-41b1-acb3-b9ee0adbc744", + "expectedControlType": "Button", + "processors": "", + "interactions": "" + }, + { + "name": "move", + "type": "Value", + "id": "50fd2809-3aa3-4a90-988e-1facf6773553", + "expectedControlType": "Stick", + "processors": "", + "interactions": "" + }, + { + "name": "look", + "type": "Value", + "id": "c60e0974-d140-4597-a40e-9862193067e9", + "expectedControlType": "Vector2", + "processors": "", + "interactions": "" + } + ], + "bindings": [ + { + "name": "", + "id": "abb776f3-f329-4f7b-bbf8-b577d13be018", + "path": "*/{PrimaryAction}", + "interactions": "Tap,SlowTap", + "processors": "", + "groups": "", + "action": "fire", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "6530c131-b549-4f2f-ae63-0ed5c6c242f4", + "path": "/fire", + "interactions": "", + "processors": "", + "groups": "", + "action": "fire", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "e1b8c4dd-7b3a-4db6-a93a-0889b59b1afc", + "path": "/leftStick", + "interactions": "", + "processors": "", + "groups": "", + "action": "move", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "Dpad", + "id": "cefc16fc-557a-44b0-939f-2ad792876b07", + "path": "Dpad", + "interactions": "", + "processors": "", + "groups": "", + "action": "move", + "isComposite": true, + "isPartOfComposite": false + }, + { + "name": "up", + "id": "07244659-79df-461d-b329-defbe2fbc5f6", + "path": "/w", + "interactions": "", + "processors": "", + "groups": "", + "action": "move", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "down", + "id": "f0ec75cb-f02c-40d2-a33f-1fd6eab2ae0b", + "path": "/s", + "interactions": "", + "processors": "", + "groups": "", + "action": "move", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "left", + "id": "21fe6bfe-4721-4483-9f4a-a0031ade105c", + "path": "/a", + "interactions": "", + "processors": "", + "groups": "", + "action": "move", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "right", + "id": "2dd39746-c75c-4a11-838a-e59eacaf4e0b", + "path": "/d", + "interactions": "", + "processors": "", + "groups": "", + "action": "move", + "isComposite": false, + "isPartOfComposite": true + }, + { + "name": "", + "id": "f96cc25e-7a56-479c-b093-65340e94c1ab", + "path": "/move", + "interactions": "", + "processors": "", + "groups": "", + "action": "move", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "c106d6e6-2780-47ff-b318-396171bd54cc", + "path": "/rightStick", + "interactions": "", + "processors": "", + "groups": "", + "action": "look", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "578caa03-6827-4797-adfc-a59770c437fe", + "path": "/delta", + "interactions": "", + "processors": "ScaleVector2(x=2,y=2)", + "groups": "", + "action": "look", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "f93b4751-8811-456b-8827-af4eb2cf5fab", + "path": "/look", + "interactions": "", + "processors": "", + "groups": "", + "action": "look", + "isComposite": false, + "isPartOfComposite": false + } + ] + } + ], + "controlSchemes": [] +} \ No newline at end of file diff --git a/Assets/Samples/VisualizerSamples/SimpleControls.inputactions.meta b/Assets/Samples/VisualizerSamples/SimpleControls.inputactions.meta new file mode 100644 index 000000000..2ba9968f2 --- /dev/null +++ b/Assets/Samples/VisualizerSamples/SimpleControls.inputactions.meta @@ -0,0 +1,14 @@ +fileFormatVersion: 2 +guid: dc782cd8f65d34f0a9c0e85380a5b684 +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 11500000, guid: 8404be70184654265930450def6a9037, type: 3} + generateWrapperCode: 0 + wrapperCodePath: + wrapperClassName: + wrapperCodeNamespace: diff --git a/Assets/Samples/VisualizerSamples/SimpleControlsVis.prefab b/Assets/Samples/VisualizerSamples/SimpleControlsVis.prefab new file mode 100644 index 000000000..4fe052a08 --- /dev/null +++ b/Assets/Samples/VisualizerSamples/SimpleControlsVis.prefab @@ -0,0 +1,291 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &1309930466035750405 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1309930466035750406} + - component: {fileID: 1309930466035750407} + m_Layer: 0 + m_Name: MoveActionVis + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1309930466035750406 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1309930466035750405} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1309930466712146553} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1309930466035750407 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1309930466035750405} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 939ce9f3839b54466af594f7854ed222, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Label: Move + m_HistorySamples: 500 + m_TimeWindow: 4 + m_Rect: + serializedVersion: 2 + x: 225 + y: 125 + width: 150 + height: 150 + m_Visualization: 1 + m_ActionReference: {fileID: 0} + m_ActionName: move + m_PlayerIndex: 0 + m_ShowControlName: 1 +--- !u!1 &1309930466250040071 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1309930466250040120} + - component: {fileID: 1309930466250040121} + m_Layer: 0 + m_Name: FireActionVis + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1309930466250040120 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1309930466250040071} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1309930466712146553} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1309930466250040121 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1309930466250040071} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 939ce9f3839b54466af594f7854ed222, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Label: Fire + m_HistorySamples: 500 + m_TimeWindow: 4 + m_Rect: + serializedVersion: 2 + x: 50 + y: 50 + width: 50 + height: 50 + m_Visualization: 1 + m_ActionReference: {fileID: 0} + m_ActionName: fire + m_PlayerIndex: 0 + m_ShowControlName: 1 +--- !u!1 &1309930466712146503 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1309930466712146553} + - component: {fileID: 1309930466712146552} + m_Layer: 0 + m_Name: SimpleControlsVis + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1309930466712146553 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1309930466712146503} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 955.3655, y: 464.9797, z: -160.45508} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 1309930466250040120} + - {fileID: 1309930467610566051} + - {fileID: 1309930467894820737} + - {fileID: 1309930466035750406} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1309930466712146552 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1309930466712146503} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 939ce9f3839b54466af594f7854ed222, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Label: + m_HistorySamples: 500 + m_TimeWindow: 3 + m_Rect: + serializedVersion: 2 + x: 0 + y: 0 + width: 300 + height: 30 + m_Visualization: 0 + m_ActionReference: {fileID: 0} + m_ActionName: + m_PlayerIndex: 0 + m_ShowControlName: 0 +--- !u!1 &1309930467610566049 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1309930467610566051} + - component: {fileID: 1309930467610566050} + m_Layer: 0 + m_Name: FireActionVis + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1309930467610566051 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1309930467610566049} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1309930466712146553} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1309930467610566050 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1309930467610566049} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 939ce9f3839b54466af594f7854ed222, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Label: + m_HistorySamples: 500 + m_TimeWindow: 4 + m_Rect: + serializedVersion: 2 + x: 110 + y: 50 + width: 200 + height: 50 + m_Visualization: 2 + m_ActionReference: {fileID: 0} + m_ActionName: fire + m_PlayerIndex: 0 + m_ShowControlName: 0 +--- !u!1 &1309930467894820736 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1309930467894820737} + - component: {fileID: 1309930467894820738} + m_Layer: 0 + m_Name: LookActionVis + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1309930467894820737 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1309930467894820736} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1309930466712146553} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1309930467894820738 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1309930467894820736} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 939ce9f3839b54466af594f7854ed222, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Label: Look + m_HistorySamples: 1000 + m_TimeWindow: 4 + m_Rect: + serializedVersion: 2 + x: 50 + y: 125 + width: 150 + height: 150 + m_Visualization: 1 + m_ActionReference: {fileID: 0} + m_ActionName: look + m_PlayerIndex: 0 + m_ShowControlName: 1 diff --git a/Assets/Samples/VisualizerSamples/SimpleControlsVis.prefab.meta b/Assets/Samples/VisualizerSamples/SimpleControlsVis.prefab.meta new file mode 100644 index 000000000..a2b748d99 --- /dev/null +++ b/Assets/Samples/VisualizerSamples/SimpleControlsVis.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: cd3e0c715b35445fbb238f50ba9c9332 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Samples/VisualizerSamples/SimpleControlsVisualizer.unity b/Assets/Samples/VisualizerSamples/SimpleControlsVisualizer.unity new file mode 100644 index 000000000..e2de791b9 --- /dev/null +++ b/Assets/Samples/VisualizerSamples/SimpleControlsVisualizer.unity @@ -0,0 +1,337 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 11 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 1 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ShowResolutionOverlay: 1 + m_ExportTrainingData: 0 + m_LightingDataAsset: {fileID: 0} + m_UseShadowmask: 1 +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &524695744 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 524695745} + - component: {fileID: 524695746} + m_Layer: 0 + m_Name: Player + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &524695745 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 524695744} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 955.3655, y: 464.9797, z: -160.45508} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &524695746 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 524695744} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 62899f850307741f2a39c98a8b639597, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Actions: {fileID: -944628639613478452, guid: dc782cd8f65d34f0a9c0e85380a5b684, + type: 3} + m_NotificationBehavior: 0 + m_UIInputModule: {fileID: 0} + m_DeviceLostEvent: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.InputSystem.PlayerInput.PlayerInput+DeviceLostEvent, Unity.InputSystem, + Version=0.9.1.0, Culture=neutral, PublicKeyToken=null + m_DeviceRegainedEvent: + m_PersistentCalls: + m_Calls: [] + m_TypeName: UnityEngine.InputSystem.PlayerInput.PlayerInput+DeviceRegainedEvent, + Unity.InputSystem, Version=0.9.1.0, Culture=neutral, PublicKeyToken=null + m_ActionEvents: [] + m_AutoSwitchControlScheme: 0 + m_DefaultControlScheme: + m_DefaultActionMap: 265c38f5-dd18-4d34-b198-aec58e1627ff + m_SplitScreenIndex: -1 + m_Camera: {fileID: 0} +--- !u!1 &676010914 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 676010918} + - component: {fileID: 676010917} + - component: {fileID: 676010916} + m_Layer: 0 + m_Name: Main Camera + m_TagString: MainCamera + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!81 &676010916 +AudioListener: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 676010914} + m_Enabled: 1 +--- !u!20 &676010917 +Camera: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 676010914} + m_Enabled: 1 + serializedVersion: 2 + m_ClearFlags: 2 + m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} + m_projectionMatrixMode: 1 + m_GateFitMode: 2 + m_FOVAxisMode: 0 + m_SensorSize: {x: 36, y: 24} + m_LensShift: {x: 0, y: 0} + m_FocalLength: 50 + m_NormalizedViewPortRect: + serializedVersion: 2 + x: 0 + y: 0 + width: 1 + height: 1 + near clip plane: 0.3 + far clip plane: 1000 + field of view: 60 + orthographic: 0 + orthographic size: 5 + m_Depth: -1 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingPath: -1 + m_TargetTexture: {fileID: 0} + m_TargetDisplay: 0 + m_TargetEye: 3 + m_HDR: 1 + m_AllowMSAA: 1 + m_AllowDynamicResolution: 0 + m_ForceIntoRT: 0 + m_OcclusionCulling: 1 + m_StereoConvergence: 10 + m_StereoSeparation: 0.022 +--- !u!4 &676010918 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 676010914} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 1, z: -10} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1001 &1309930466053861656 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 1309930466712146503, guid: cd3e0c715b35445fbb238f50ba9c9332, + type: 3} + propertyPath: m_Name + value: SimpleControlsVis + objectReference: {fileID: 0} + - target: {fileID: 1309930466712146553, guid: cd3e0c715b35445fbb238f50ba9c9332, + type: 3} + propertyPath: m_LocalPosition.x + value: 955.3655 + objectReference: {fileID: 0} + - target: {fileID: 1309930466712146553, guid: cd3e0c715b35445fbb238f50ba9c9332, + type: 3} + propertyPath: m_LocalPosition.y + value: 464.9797 + objectReference: {fileID: 0} + - target: {fileID: 1309930466712146553, guid: cd3e0c715b35445fbb238f50ba9c9332, + type: 3} + propertyPath: m_LocalPosition.z + value: -160.45508 + objectReference: {fileID: 0} + - target: {fileID: 1309930466712146553, guid: cd3e0c715b35445fbb238f50ba9c9332, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1309930466712146553, guid: cd3e0c715b35445fbb238f50ba9c9332, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1309930466712146553, guid: cd3e0c715b35445fbb238f50ba9c9332, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1309930466712146553, guid: cd3e0c715b35445fbb238f50ba9c9332, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 1309930466712146553, guid: cd3e0c715b35445fbb238f50ba9c9332, + type: 3} + propertyPath: m_RootOrder + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 1309930466712146553, guid: cd3e0c715b35445fbb238f50ba9c9332, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1309930466712146553, guid: cd3e0c715b35445fbb238f50ba9c9332, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1309930466712146553, guid: cd3e0c715b35445fbb238f50ba9c9332, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: cd3e0c715b35445fbb238f50ba9c9332, type: 3} diff --git a/Assets/Samples/VisualizerSamples/SimpleControlsVisualizer.unity.meta b/Assets/Samples/VisualizerSamples/SimpleControlsVisualizer.unity.meta new file mode 100644 index 000000000..361908292 --- /dev/null +++ b/Assets/Samples/VisualizerSamples/SimpleControlsVisualizer.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 14281ec1c6daa42bc97c543e027b5839 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Samples/VisualizerSamples/VisualizationHelpers.cs b/Assets/Samples/VisualizerSamples/VisualizationHelpers.cs new file mode 100644 index 000000000..18990d884 --- /dev/null +++ b/Assets/Samples/VisualizerSamples/VisualizationHelpers.cs @@ -0,0 +1,670 @@ +using System; +using UnityEngine.InputSystem.Utilities; +using Unity.Collections.LowLevel.Unsafe; +using UnityEngine.InputSystem.LowLevel; + +////REVIEW: for vector2 visualizers of sticks, it could be useful to also visualize deadzones and raw values + +namespace UnityEngine.InputSystem.Samples +{ + internal static class VisualizationHelpers + { + public enum Axis { X, Y, Z } + + public abstract class Visualizer + { + public abstract void OnDraw(Rect rect); + public abstract void AddSample(object value, double time); + } + + public abstract class ValueVisualizer : Visualizer + where TValue : struct + { + public RingBuffer samples; + public RingBuffer samplesText; + + protected ValueVisualizer(int numSamples = 10) + { + samples = new RingBuffer(numSamples); + samplesText = new RingBuffer(numSamples); + } + + public override void AddSample(object value, double time) + { + var v = default(TValue); + + if (value != null) + { + if (!(value is TValue val)) + throw new ArgumentException( + $"Expecting value of type '{typeof(TValue).Name}' but value of type '{value?.GetType().Name}' instead", + nameof(value)); + v = val; + } + + samples.Append(v); + samplesText.Append(new GUIContent(v.ToString())); + } + } + + // Visualizes integer and real type primitives. + public class ScalarVisualizer : ValueVisualizer + where TValue : struct + { + public TValue limitMin; + public TValue limitMax; + public TValue min; + public TValue max; + + public ScalarVisualizer(int numSamples = 10) + : base(numSamples) + { + } + + public override void OnDraw(Rect rect) + { + // For now, only draw the current value. + DrawRectangle(rect, new Color(1, 1, 1, 0.1f)); + if (samples.count == 0) + return; + var sample = samples[samples.count - 1]; + if (Compare(sample, default) == 0) + return; + if (Compare(limitMin, default) != 0) + { + // Two-way visualization with positive and negative side. + throw new NotImplementedException(); + } + else + { + // One-way visualization with only positive side. + var ratio = Divide(sample, limitMax); + var fillRect = rect; + fillRect.width = rect.width * ratio; + DrawRectangle(fillRect, new Color(0, 1, 0, 0.75f)); + + var valuePos = new Vector2(fillRect.xMax, fillRect.y + fillRect.height / 2); + DrawText(samplesText[samples.count - 1], valuePos, ValueTextStyle); + } + } + + public override void AddSample(object value, double time) + { + base.AddSample(value, time); + + if (value != null) + { + var val = (TValue)value; + if (Compare(min, val) > 0) + min = val; + if (Compare(max, val) < 0) + max = val; + } + } + + private static unsafe int Compare(TValue left, TValue right) + { + var leftPtr = UnsafeUtility.AddressOf(ref left); + var rightPtr = UnsafeUtility.AddressOf(ref right); + if (typeof(TValue) == typeof(int)) + return ((int*)leftPtr)->CompareTo(*(int*)rightPtr); + if (typeof(TValue) == typeof(float)) + return ((float*)leftPtr)->CompareTo(*(float*)rightPtr); + throw new NotImplementedException("Scalar value type: " + typeof(TValue).Name); + } + + private static unsafe void Subtract(ref TValue left, TValue right) + { + var leftPtr = UnsafeUtility.AddressOf(ref left); + var rightPtr = UnsafeUtility.AddressOf(ref right); + + if (typeof(TValue) == typeof(int)) + *(int*)leftPtr = *(int*)leftPtr - *(int*)rightPtr; + if (typeof(TValue) == typeof(float)) + *(float*)leftPtr = *(float*)leftPtr - *(float*)rightPtr; + throw new NotImplementedException("Scalar value type: " + typeof(TValue).Name); + } + + private static unsafe float Divide(TValue left, TValue right) + { + var leftPtr = UnsafeUtility.AddressOf(ref left); + var rightPtr = UnsafeUtility.AddressOf(ref right); + + if (typeof(TValue) == typeof(int)) + return (float)*(int*)leftPtr / *(int*)rightPtr; + if (typeof(TValue) == typeof(float)) + return *(float*)leftPtr / *(float*)rightPtr; + throw new NotImplementedException("Scalar value type: " + typeof(TValue).Name); + } + } + + ////TODO: allow asymmetric center (i.e. center not being a midpoint of rectangle) + ////TODO: enforce proper proportion between X and Y; it's confusing that X and Y can have different units yet have the same length + public class Vector2Visualizer : ValueVisualizer + { + // Our value space extends radially from the center, i.e. we have + // 360 discrete directions. Sampling at that granularity doesn't work + // super well in visualizations so we quantize to 3 degree increments. + public Vector2[] maximums = new Vector2[360 / 3]; + public Vector2 limits = new Vector2(1, 1); + + private GUIContent limitsXText; + private GUIContent limitsYText; + + public Vector2Visualizer(int numSamples = 10) + : base(numSamples) + { + } + + public override void AddSample(object value, double time) + { + base.AddSample(value, time); + + if (value != null) + { + // Keep track of radial maximums. + var vector = (Vector2)value; + var angle = Vector2.SignedAngle(Vector2.right, vector); + if (angle < 0) + angle = 360 + angle; + var angleInt = Mathf.FloorToInt(angle) / 3; + if (vector.sqrMagnitude > maximums[angleInt].sqrMagnitude) + maximums[angleInt] = vector; + + // Extend limits if value is out of range. + var limitX = Mathf.Max(Mathf.Abs(vector.x), limits.x); + var limitY = Mathf.Max(Mathf.Abs(vector.y), limits.y); + if (!Mathf.Approximately(limitX, limits.x)) + { + limits.x = limitX; + limitsXText = null; + } + if (!Mathf.Approximately(limitY, limits.y)) + { + limits.y = limitY; + limitsYText = null; + } + } + } + + public override void OnDraw(Rect rect) + { + DrawRectangle(rect, new Color(1, 1, 1, 0.1f)); + DrawAxis(Axis.X, rect, new Color(0, 1, 0, 0.75f)); + DrawAxis(Axis.Y, rect, new Color(0, 1, 0, 0.75f)); + + var sampleCount = samples.count; + if (sampleCount == 0) + return; + + // If limits aren't (1,1), show the actual values. + if (limits != new Vector2(1, 1)) + { + if (limitsXText == null) + limitsXText = new GUIContent(limits.x.ToString()); + if (limitsYText == null) + limitsYText = new GUIContent(limits.y.ToString()); + + var limitsXSize = ValueTextStyle.CalcSize(limitsXText); + var limitsXPos = new Vector2(rect.x - limitsXSize.x, rect.y - 5); + var limitsYPos = new Vector2(rect.xMax, rect.yMax); + + DrawText(limitsXText, limitsXPos, ValueTextStyle); + DrawText(limitsYText, limitsYPos, ValueTextStyle); + } + + // Draw maximums. + var numMaximums = 0; + var firstMaximumPos = default(Vector2); + var lastMaximumPos = default(Vector2); + for (var i = 0; i < 360 / 3; ++i) + { + var value = maximums[i]; + if (value == default) + continue; + var valuePos = PixelPosForValue(value, rect); + if (numMaximums > 0) + DrawLine(lastMaximumPos, valuePos, new Color(1, 1, 1, 0.25f)); + else + firstMaximumPos = valuePos; + lastMaximumPos = valuePos; + ++numMaximums; + } + if (numMaximums > 1) + DrawLine(lastMaximumPos, firstMaximumPos, new Color(1, 1, 1, 0.25f)); + + // Draw samples. + var alphaStep = 1f / sampleCount; + var alpha = 1f; + for (var i = sampleCount - 1; i >= 0; --i) // Go newest to oldest. + { + var value = samples[i]; + var valueRect = RectForValue(value, rect); + DrawRectangle(valueRect, new Color(1, 0, 0, alpha)); + alpha -= alphaStep; + } + + // Print value of most recent sample. Draw last so + // we draw over the other stuff. + var lastSample = samples[sampleCount - 1]; + var lastSamplePos = PixelPosForValue(lastSample, rect); + lastSamplePos.x += 3; + lastSamplePos.y += 3; + DrawText(samplesText[sampleCount - 1], lastSamplePos, ValueTextStyle); + } + + private Rect RectForValue(Vector2 value, Rect rect) + { + var pos = PixelPosForValue(value, rect); + return new Rect(pos.x - 1, pos.y - 1, 2, 2); + } + + private Vector2 PixelPosForValue(Vector2 value, Rect rect) + { + var center = rect.center; + var x = Mathf.Abs(value.x) / limits.x * Mathf.Sign(value.x); + var y = Mathf.Abs(value.y) / limits.y * Mathf.Sign(value.y) * -1; // GUI Y is upside down. + var xInPixels = x * rect.width / 2; + var yInPixels = y * rect.height / 2; + return new Vector2(center.x + xInPixels, + center.y + yInPixels); + } + } + + // Y axis is time, X axis can be multiple visualizations. + public class TimelineVisualizer : Visualizer + { + public bool showLegend { get; set; } + public bool showLimits { get; set; } + public TimeUnit timeUnit { get; set; } = TimeUnit.Seconds; + public GUIContent valueUnit { get; set; } + ////REVIEW: should this be per timeline? + public int timelineCount => m_Timelines != null ? m_Timelines.Length : 0; + public int historyDepth { get; set; } = 100; + + public Vector2 limitsY + { + get => m_LimitsY; + set + { + m_LimitsY = value; + m_LimitsYMin = null; + m_LimitsYMax = null; + } + } + + public TimelineVisualizer(float totalTimeUnitsShown = 4) + { + m_TotalTimeUnitsShown = totalTimeUnitsShown; + } + + public override void OnDraw(Rect rect) + { + var endTime = Time.realtimeSinceStartup; + var startTime = endTime - m_TotalTimeUnitsShown; + var endFrame = InputState.updateCount; + var startFrame = endFrame - (int)m_TotalTimeUnitsShown; + + for (var i = 0; i < timelineCount; ++i) + { + var timeline = m_Timelines[i]; + var sampleCount = timeUnit == TimeUnit.Frames + ? timeline.frameSamples.count + : timeline.timeSamples.count; + + // Set up clip rect so that we can do stuff like render lines to samples + // falling outside the render rectangle and have them get clipped. + GUI.BeginGroup(rect); + var plotType = timeline.plotType; + var lastPos = default(Vector2); + var timeUnitsPerPixel = rect.width / m_TotalTimeUnitsShown; + var color = m_Timelines[i].color; + for (var n = sampleCount - 1; n >= 0; --n) + { + var sample = timeUnit == TimeUnit.Frames + ? timeline.frameSamples[n].value + : timeline.timeSamples[n].value; + + ////TODO: respect limitsY + + float y; + if (sample.isEmpty) + y = 0.5f; + else + y = sample.ToSingle(); + + y /= limitsY.y; + + var deltaTime = timeUnit == TimeUnit.Frames + ? timeline.frameSamples[n].frame - startFrame + : timeline.timeSamples[n].time - startTime; + var pos = new Vector2(deltaTime * timeUnitsPerPixel, rect.height - y * rect.height); + + if (plotType == PlotType.LineGraph) + { + if (n != sampleCount - 1) + { + DrawLine(lastPos, pos, color, 2); + if (pos.x < 0) + break; + } + } + else if (plotType == PlotType.BarChart) + { + ////TODO: make rectangles have a progressively stronger hue or saturation + var barRect = new Rect(pos.x, pos.y, timeUnitsPerPixel, y * limitsY.y * rect.height); + DrawRectangle(barRect, color); + } + + lastPos = pos; + } + GUI.EndGroup(); + } + + if (showLegend && timelineCount > 0) + { + var legendRect = rect; + legendRect.x += rect.width + 2; + legendRect.width = 400; + legendRect.height = ValueTextStyle.CalcHeight(m_Timelines[0].name, 400); + for (var i = 0; i < m_Timelines.Length; ++i) + { + var colorTagRect = legendRect; + colorTagRect.width = 5; + var labelRect = legendRect; + labelRect.x += 8; + labelRect.width -= 8; + + DrawRectangle(colorTagRect, m_Timelines[i].color); + DrawText(m_Timelines[i].name, labelRect.position, ValueTextStyle); + + legendRect.y += labelRect.height + 2; + } + } + + if (showLimits) + { + if (m_LimitsYMax == null) + m_LimitsYMax = new GUIContent(m_LimitsY.y.ToString()); + if (m_LimitsYMin == null) + m_LimitsYMin = new GUIContent(m_LimitsY.x.ToString()); + + DrawText(m_LimitsYMax, new Vector2(rect.x + rect.width, rect.y), ValueTextStyle); + DrawText(m_LimitsYMin, new Vector2(rect.x + rect.width, rect.y + rect.height), ValueTextStyle); + } + } + + public override void AddSample(object value, double time) + { + if (timelineCount == 0) + throw new InvalidOperationException("Must have set up a timeline first"); + AddSample(0, PrimitiveValue.FromObject(value), (float)time); + } + + public int AddTimeline(string name, Color color, PlotType plotType = default) + { + var timeline = new Timeline + { + name = new GUIContent(name), + color = color, + plotType = plotType, + }; + if (timeUnit == TimeUnit.Frames) + timeline.frameSamples = new RingBuffer(historyDepth); + else + timeline.timeSamples = new RingBuffer(historyDepth); + + var index = timelineCount; + Array.Resize(ref m_Timelines, timelineCount + 1); + m_Timelines[index] = timeline; + + return index; + } + + public int GetTimeline(string name) + { + for (var i = 0; i < timelineCount; ++i) + if (string.Compare(m_Timelines[i].name.text, name, StringComparison.InvariantCultureIgnoreCase) == 0) + return i; + return -1; + } + + // Add a time-based sample. + public void AddSample(int timelineIndex, PrimitiveValue value, float time) + { + m_Timelines[timelineIndex].timeSamples.Append(new TimeSample + { + value = value, + time = time + }); + } + + // Add a frame-based sample. + public ref PrimitiveValue GetOrCreateSample(int timelineIndex, int frame) + { + ref var timeline = ref m_Timelines[timelineIndex]; + ref var samples = ref timeline.frameSamples; + var count = samples.count; + if (count > 0) + { + if (samples[count - 1].frame == frame) + return ref samples[count - 1].value; + + Debug.Assert(samples[count - 1].frame < frame, "Frame numbers must be ascending"); + } + + return ref samples.Append(new FrameSample {frame = frame}).value; + } + + private float m_TotalTimeUnitsShown; + private Vector2 m_LimitsY = new Vector2(-1, 1); + private GUIContent m_LimitsYMin; + private GUIContent m_LimitsYMax; + private Timeline[] m_Timelines; + + private struct TimeSample + { + public PrimitiveValue value; + public float time; + } + + private struct FrameSample + { + public PrimitiveValue value; + public int frame; + } + + private struct Timeline + { + public GUIContent name; + public Color color; + public RingBuffer timeSamples; + public RingBuffer frameSamples; + public PrimitiveValue minValue; + public PrimitiveValue maxValue; + public PlotType plotType; + } + + public enum PlotType + { + LineGraph, + BarChart, + } + + public enum TimeUnit + { + Seconds, + Frames, + } + } + + public static void DrawAxis(Axis axis, Rect rect, Color color = default, float width = 1) + { + Vector2 start, end, tickOffset; + switch (axis) + { + case Axis.X: + start = new Vector2(rect.x, rect.y + rect.height / 2); + end = new Vector2(start.x + rect.width, rect.y + rect.height / 2); + tickOffset = new Vector2(0, 3); + break; + + case Axis.Y: + start = new Vector2(rect.x + rect.width / 2, rect.y); + end = new Vector2(start.x, rect.y + rect.height); + tickOffset = new Vector2(3, 0); + break; + + case Axis.Z: + // From bottom left corner to upper right corner. + start = new Vector2(rect.x, rect.yMax); + end = new Vector2(rect.xMax, rect.y); + tickOffset = new Vector2(1.5f, 1.5f); + break; + + default: + throw new NotImplementedException(); + } + + ////TODO: label limits + + DrawLine(start, end, color, width); + DrawLine(start - tickOffset, start + tickOffset, color, width); + DrawLine(end - tickOffset, end + tickOffset, color, width); + } + + public static void DrawRectangle(Rect rect, Color color) + { + var savedColor = GUI.color; + GUI.color = color; + GUI.DrawTexture(rect, OnePixTex); + GUI.color = savedColor; + } + + public static void DrawText(string text, Vector2 pos, GUIStyle style) + { + var content = new GUIContent(text); + DrawText(content, pos, style); + } + + public static void DrawText(GUIContent text, Vector2 pos, GUIStyle style) + { + var content = new GUIContent(text); + var size = style.CalcSize(content); + var rect = new Rect(pos.x, pos.y, size.x, size.y); + style.Draw(rect, content, false, false, false, false); + } + + // Adapted from http://wiki.unity3d.com/index.php?title=DrawLine + public static void DrawLine(Vector2 pointA, Vector2 pointB, Color color = default, float width = 1) + { + // Save the current GUI matrix, since we're going to make changes to it. + var matrix = GUI.matrix; + + // Store current GUI color, so we can switch it back later, + // and set the GUI color to the color parameter + var savedColor = GUI.color; + GUI.color = color; + + // Determine the angle of the line. + var angle = Vector3.Angle(pointB - pointA, Vector2.right); + + // Vector3.Angle always returns a positive number. + // If pointB is above pointA, then angle needs to be negative. + if (pointA.y > pointB.y) + angle = -angle; + + // Use ScaleAroundPivot to adjust the size of the line. + // We could do this when we draw the texture, but by scaling it here we can use + // non-integer values for the width and length (such as sub 1 pixel widths). + // Note that the pivot point is at +.5 from pointA.y, this is so that the width of the line + // is centered on the origin at pointA. + GUIUtility.ScaleAroundPivot(new Vector2((pointB - pointA).magnitude, width), new Vector2(pointA.x, pointA.y + 0.5f)); + + // Set the rotation for the line. + // The angle was calculated with pointA as the origin. + GUIUtility.RotateAroundPivot(angle, pointA); + + // Finally, draw the actual line. + // We're really only drawing a 1x1 texture from pointA. + // The matrix operations done with ScaleAroundPivot and RotateAroundPivot will make this + // render with the proper width, length, and angle. + GUI.DrawTexture(new Rect(pointA.x, pointA.y, 1, 1), OnePixTex); + + // We're done. Restore the GUI matrix and GUI color to whatever they were before. + GUI.matrix = matrix; + GUI.color = savedColor; + } + + private static Texture2D s_OnePixTex; + private static GUIStyle s_ValueTextStyle; + + internal static GUIStyle ValueTextStyle + { + get + { + if (s_ValueTextStyle == null) + { + s_ValueTextStyle = new GUIStyle(); + s_ValueTextStyle.fontSize -= 2; + s_ValueTextStyle.normal.textColor = Color.white; + } + return s_ValueTextStyle; + } + } + + internal static Texture2D OnePixTex + { + get + { + if (s_OnePixTex == null) + s_OnePixTex = new Texture2D(1, 1); + return s_OnePixTex; + } + } + + public struct RingBuffer + { + public TValue[] array; + public int head; + public int count; + + public RingBuffer(int size) + { + array = new TValue[size]; + head = 0; + count = 0; + } + + public ref TValue Append(TValue value) + { + int index; + var bufferSize = array.Length; + if (count < bufferSize) + { + Debug.Assert(head == 0, "Head can't have moved if buffer isn't full yet"); + index = count; + ++count; + } + else + { + // Buffer is full. Bump head. + index = (head + count) % bufferSize; + ++head; + } + array[index] = value; + return ref array[index]; + } + + public ref TValue this[int index] + { + get + { + if (index < 0 || index >= count) + throw new ArgumentOutOfRangeException(nameof(index)); + return ref array[(head + index) % array.Length]; + } + } + } + } +} diff --git a/Assets/Samples/VisualizerSamples/VisualizationHelpers.cs.meta b/Assets/Samples/VisualizerSamples/VisualizationHelpers.cs.meta new file mode 100644 index 000000000..16ef34fc5 --- /dev/null +++ b/Assets/Samples/VisualizerSamples/VisualizationHelpers.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: ad5cfc4797aad4aa1b10dc648646ba5e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Tests/InputSystem/CorePerformanceTests.cs b/Assets/Tests/InputSystem/CorePerformanceTests.cs index c89e2d556..e2f0706fb 100644 --- a/Assets/Tests/InputSystem/CorePerformanceTests.cs +++ b/Assets/Tests/InputSystem/CorePerformanceTests.cs @@ -5,28 +5,22 @@ using UnityEngine.InputSystem.LowLevel; using NUnit.Framework; using UnityEngine; -////TODO: just fold performance tests into "normal" tests; performance should be a functional aspect like everything else +// These tests are all explicit (i.e. manually run) as we don't have a performance testing +// rig in place. -internal class CorePerformanceTests +// IMPORTANT: When running in editor, make sure to turn off debugging (disable "Editor Attaching" in +// editor preferences and restart editor) when running tests here. If debugging is enabled, +// the code will run A LOT slower. + +internal class CorePerformanceTests : InputTestFixture { - [SetUp] - public void Setup() - { - InputSystem.SaveAndReset(); - } - - [TearDown] - public void TearDown() - { - InputSystem.Restore(); - } - ////TODO: same test but with several actions listening on each gamepad // Performing a full state update on 10 devices should take less than 0.01 ms. + // STATUS: On 2014 MBP with 2.8GHz i7, passes in less than half that time. [Test] [Category("Performance")] - [Ignore("TODO")] - public void TODO_CanUpdate10GamepadsInLessThanPointZeroOneMilliseconds() + [Explicit] + public void CanUpdate10GamepadsInLessThanPointZeroOneMilliseconds() { const int kNumGamepads = 10; @@ -34,20 +28,28 @@ internal class CorePerformanceTests for (var i = 0; i < kNumGamepads; ++i) gamepads[i] = InputSystem.AddDevice(); - var startTime = Time.realtimeSinceStartup; - - // Generate a full state update for each gamepad. - for (var i = 0; i < kNumGamepads; ++i) - InputSystem.QueueStateEvent(gamepads[i], new GamepadState()); - - // Now run the update. + // Perform initial update to get any first-update-only stuff out of the way. InputSystem.Update(); - var endTime = Time.realtimeSinceStartup; - var totalTime = endTime - startTime; + var bestTime = float.MaxValue; + for (var n = 0; n < 20; ++n) + { + var startTime = Time.realtimeSinceStartup; - Assert.That(totalTime, Is.LessThan(0.01 / 1000.0)); - Debug.Log($"{MethodBase.GetCurrentMethod().Name}: {totalTime * 1000}ms"); + for (var i = 0; i < kNumGamepads; ++i) + InputSystem.QueueStateEvent(gamepads[i], new GamepadState()); + + InputSystem.Update(); + + var endTime = Time.realtimeSinceStartup; + var totalTime = endTime - startTime; + + bestTime = Mathf.Min(totalTime, bestTime); + } + + + Assert.That(bestTime, Is.LessThan(0.01 / 1000.0)); + Debug.Log($"{MethodBase.GetCurrentMethod().Name}: {bestTime * 1000}ms"); } #if UNITY_EDITOR diff --git a/Assets/Tests/InputSystem/CoreTests_Actions.cs b/Assets/Tests/InputSystem/CoreTests_Actions.cs index badd3b3d3..c101ea1f4 100644 --- a/Assets/Tests/InputSystem/CoreTests_Actions.cs +++ b/Assets/Tests/InputSystem/CoreTests_Actions.cs @@ -581,6 +581,10 @@ partial class CoreTests Assert.That(stickAction.ReadValue(), Is.EqualTo(Vector2.zero) .Using(Vector2EqualityComparer.Instance)); + ////REVIEW: would be great to get boxed versions of the default values but that's much harder to do + Assert.That(buttonAction.ReadValueAsObject(), Is.Null); + Assert.That(triggerAction.ReadValueAsObject(), Is.Null); + Assert.That(stickAction.ReadValueAsObject(), Is.Null); buttonAction.Enable(); triggerAction.Enable(); @@ -592,6 +596,9 @@ partial class CoreTests Assert.That(stickAction.ReadValue(), Is.EqualTo(Vector2.zero) .Using(Vector2EqualityComparer.Instance)); + Assert.That(buttonAction.ReadValueAsObject(), Is.Null); + Assert.That(triggerAction.ReadValueAsObject(), Is.Null); + Assert.That(stickAction.ReadValueAsObject(), Is.Null); Press(gamepad.buttonSouth, queueEventOnly: true); Set(gamepad.leftTrigger, 0.234f, queueEventOnly: true); @@ -604,15 +611,24 @@ partial class CoreTests Assert.That(stickAction.ReadValue(), Is.EqualTo(new StickDeadzoneProcessor().Process(new Vector2(0.234f, 0.345f))) .Using(Vector2EqualityComparer.Instance)); + Assert.That(buttonAction.ReadValueAsObject(), Is.EqualTo(1).Within(0.00001)); + Assert.That(triggerAction.ReadValueAsObject(), Is.EqualTo(0.234).Within(0.00001)); + Assert.That(stickAction.ReadValueAsObject(), + Is.EqualTo(new StickDeadzoneProcessor().Process(new Vector2(0.234f, 0.345f))) + .Using(Vector2EqualityComparer.Instance)); InputSystem.Update(); - // NOTE: The button action "resets" its value! - Assert.That(buttonAction.ReadValue(), Is.EqualTo(0).Within(0.00001)); + Assert.That(buttonAction.ReadValue(), Is.EqualTo(1).Within(0.00001)); Assert.That(triggerAction.ReadValue(), Is.EqualTo(0.234).Within(0.00001)); Assert.That(stickAction.ReadValue(), Is.EqualTo(new StickDeadzoneProcessor().Process(new Vector2(0.234f, 0.345f))) .Using(Vector2EqualityComparer.Instance)); + Assert.That(buttonAction.ReadValueAsObject(), Is.EqualTo(1).Within(0.00001)); + Assert.That(triggerAction.ReadValueAsObject(), Is.EqualTo(0.234).Within(0.00001)); + Assert.That(stickAction.ReadValueAsObject(), + Is.EqualTo(new StickDeadzoneProcessor().Process(new Vector2(0.234f, 0.345f))) + .Using(Vector2EqualityComparer.Instance)); // Disabling an action should result in all default values. buttonAction.Disable(); @@ -624,6 +640,9 @@ partial class CoreTests Assert.That(stickAction.ReadValue(), Is.EqualTo(Vector2.zero) .Using(Vector2EqualityComparer.Instance)); + Assert.That(buttonAction.ReadValueAsObject(), Is.Null); + Assert.That(triggerAction.ReadValueAsObject(), Is.Null); + Assert.That(stickAction.ReadValueAsObject(), Is.Null); } [Test] @@ -762,6 +781,32 @@ partial class CoreTests Assert.That(performedWasCalled); } + [Test] + [Category("Actions")] + public void Actions_CanQueryActiveControl() + { + var gamepad = InputSystem.AddDevice(); + + var action = new InputAction(type: InputActionType.Button); + action.AddBinding(gamepad.buttonSouth); + action.AddBinding(gamepad.buttonNorth); + action.Enable(); + + Assert.That(action.activeControl, Is.Null); + + Press(gamepad.buttonSouth); + + Assert.That(action.activeControl, Is.SameAs(gamepad.buttonSouth)); + + Release(gamepad.buttonSouth); + + Assert.That(action.activeControl, Is.Null); + + Press(gamepad.buttonNorth); + + Assert.That(action.activeControl, Is.SameAs(gamepad.buttonNorth)); + } + [Test] [Category("Actions")] public void Actions_CanCreateActionsWithoutAnActionMap() diff --git a/Assets/Tests/InputSystem/CoreTests_Controls.cs b/Assets/Tests/InputSystem/CoreTests_Controls.cs index 8efc395f7..ba465db10 100644 --- a/Assets/Tests/InputSystem/CoreTests_Controls.cs +++ b/Assets/Tests/InputSystem/CoreTests_Controls.cs @@ -439,7 +439,7 @@ partial class CoreTests var receivedCalls = 0; InputSystem.onEvent += - eventPtr => + (eventPtr, device) => { ++receivedCalls; float value; @@ -479,11 +479,10 @@ partial class CoreTests float? value = null; InputSystem.onEvent += - eventPtr => + (eventPtr, _) => { Assert.That(value, Is.Null); - float eventValue; - ((AxisControl)device["extraControl"]).ReadValueFromEvent(eventPtr, out eventValue); + ((AxisControl)device["extraControl"]).ReadValueFromEvent(eventPtr, out var eventValue); value = eventValue; }; @@ -502,7 +501,7 @@ partial class CoreTests var receivedCalls = 0; InputSystem.onEvent += - eventPtr => + (eventPtr, device) => { ++receivedCalls; gamepad.leftTrigger.WriteValueIntoEvent(0.1234f, eventPtr); @@ -523,7 +522,7 @@ partial class CoreTests var receivedCalls = 0; InputSystem.onEvent += - eventPtr => + (eventPtr, device) => { ++receivedCalls; gamepad.leftTrigger.WriteValueIntoEvent(0.1234f, eventPtr); diff --git a/Assets/Tests/InputSystem/CoreTests_Editor.cs b/Assets/Tests/InputSystem/CoreTests_Editor.cs index f86a9d45e..c4486dd40 100644 --- a/Assets/Tests/InputSystem/CoreTests_Editor.cs +++ b/Assets/Tests/InputSystem/CoreTests_Editor.cs @@ -196,7 +196,7 @@ partial class CoreTests var receivedOnEvent = 0; var receivedOnDeviceChange = 0; - InputSystem.onEvent += _ => ++ receivedOnEvent; + InputSystem.onEvent += (e, d) => ++ receivedOnEvent; InputSystem.onDeviceChange += (c, d) => ++ receivedOnDeviceChange; InputSystem.Restore(); diff --git a/Assets/Tests/InputSystem/CoreTests_Events.cs b/Assets/Tests/InputSystem/CoreTests_Events.cs index 1d488d9d6..51a58e338 100644 --- a/Assets/Tests/InputSystem/CoreTests_Events.cs +++ b/Assets/Tests/InputSystem/CoreTests_Events.cs @@ -169,7 +169,7 @@ partial class CoreTests double? receivedTime = null; double? receivedInternalTime = null; InputSystem.onEvent += - eventPtr => + (eventPtr, _) => { receivedTime = eventPtr.time; receivedInternalTime = eventPtr.internalTime; @@ -275,7 +275,7 @@ partial class CoreTests var receivedEvents = new List(); InputSystem.onEvent += - eventPtr => receivedEvents.Add(*eventPtr.data); + (eventPtr, _) => receivedEvents.Add(*eventPtr.data); // First fixed update should just take everything. InputSystem.QueueStateEvent(gamepad, new GamepadState { leftTrigger = 0.1234f }, 1); @@ -364,7 +364,7 @@ partial class CoreTests var receivedEvents = new List(); InputSystem.onEvent += - eventPtr => receivedEvents.Add(*eventPtr.data); + (eventPtr, _) => receivedEvents.Add(*eventPtr.data); bool? receivedOnSettingsChange = null; InputSystem.onSettingsChange += () => receivedOnSettingsChange = true; @@ -454,7 +454,7 @@ partial class CoreTests Set(gamepad.buttonNorth, 1); Set(gamepad.leftTrigger, 0.123f); - using (var buffer = DeltaStateEvent.From(gamepad.buttonNorth, out var eventPtr)) + using (DeltaStateEvent.From(gamepad.buttonNorth, out var eventPtr)) { Assert.That(gamepad.buttonNorth.ReadValueFromEvent(eventPtr, out var val), Is.True); Assert.That(val, Is.EqualTo(1).Within(0.00001)); @@ -528,7 +528,7 @@ partial class CoreTests var device = InputSystem.AddDevice(); var receivedCalls = 0; - InputSystem.onEvent += inputEvent => + InputSystem.onEvent += (inputEvent, _) => { ++receivedCalls; Assert.That(inputEvent.IsA(), Is.True); @@ -569,7 +569,7 @@ partial class CoreTests var receivedThirdTime = 0.0; InputSystem.onEvent += - inputEvent => + (inputEvent, _) => { ++receivedCalls; if (receivedCalls == 1) @@ -605,7 +605,7 @@ partial class CoreTests var receivedCalls = 0; var receivedDeviceId = InputDevice.InvalidDeviceId; InputSystem.onEvent += - eventPtr => + (eventPtr, _) => { ++receivedCalls; receivedDeviceId = eventPtr.deviceId; @@ -630,7 +630,7 @@ partial class CoreTests var wasHandled = true; InputSystem.onEvent += - eventPtr => + (eventPtr, _) => { ++receivedCalls; wasHandled = eventPtr.handled; @@ -657,7 +657,7 @@ partial class CoreTests public void Events_CanPreventEventsFromBeingProcessed() { InputSystem.onEvent += - inputEvent => + (inputEvent, _) => { // If we mark the event handled, the system should skip it and not // let it go to the device. @@ -678,10 +678,7 @@ partial class CoreTests [InputControl(layout = "Axis")] [FieldOffset(0)] public ushort value; - public FourCC format - { - get { return new FourCC('T', 'E', 'S', 'T'); } - } + public FourCC format => new FourCC('T', 'E', 'S', 'T'); } [InputControlLayout(stateType = typeof(StateWith2Bytes))] @@ -712,7 +709,7 @@ partial class CoreTests InputSystem.QueueStateEvent(device, new StateWith2Bytes()); InputSystem.onEvent += - eventPtr => + (eventPtr, _) => { // Event addresses must be 4-byte aligned but sizeInBytes must not have been altered. Assert.That((Int64)eventPtr.data % 4, Is.EqualTo(0)); @@ -834,7 +831,7 @@ partial class CoreTests var secondId = InputEvent.InvalidId; InputSystem.onEvent += - eventPtr => + (eventPtr, _) => { ++receivedCalls; if (receivedCalls == 1) @@ -992,7 +989,7 @@ partial class CoreTests var mouse = InputSystem.AddDevice(); InputSystem.onEvent += - eventPtr => + (eventPtr, _) => { // For every control that isn't contained in a state event, GetStatePtrFromStateEvent() should // return IntPtr.Zero. diff --git a/Assets/Tests/InputSystem/CoreTests_State.cs b/Assets/Tests/InputSystem/CoreTests_State.cs index 8e1a6e267..9dcae27df 100644 --- a/Assets/Tests/InputSystem/CoreTests_State.cs +++ b/Assets/Tests/InputSystem/CoreTests_State.cs @@ -20,6 +20,58 @@ using UnityEngine.InputSystem.Editor; partial class CoreTests { + [Test] + [Category("State")] + public void State_CanGetCurrentUpdateType() + { + InputSystem.settings.updateMode = InputSettings.UpdateMode.ProcessEventsInDynamicUpdate; + + Assert.That(InputState.currentUpdateType, Is.EqualTo(default(InputUpdateType))); + + InputSystem.Update(); + Assert.That(InputState.currentUpdateType, Is.EqualTo(InputUpdateType.Dynamic)); + + InputSystem.settings.updateMode = InputSettings.UpdateMode.ProcessEventsInFixedUpdate; + Assert.That(InputState.currentUpdateType, Is.EqualTo(InputUpdateType.Dynamic)); + + InputSystem.Update(); + Assert.That(InputState.currentUpdateType, Is.EqualTo(InputUpdateType.Fixed)); + + InputSystem.settings.updateMode = InputSettings.UpdateMode.ProcessEventsManually; + Assert.That(InputState.currentUpdateType, Is.EqualTo(InputUpdateType.Fixed)); + + InputSystem.Update(); + Assert.That(InputState.currentUpdateType, Is.EqualTo(InputUpdateType.Manual)); + + #if UNITY_EDITOR + runtime.onShouldRunUpdate = _ => true; + InputSystem.Update(InputUpdateType.Editor); + Assert.That(InputState.currentUpdateType, Is.EqualTo(InputUpdateType.Editor)); + #endif + } + + [Test] + [Category("State")] + public void State_CanGetUpdateCount() + { + Assert.That(InputState.updateCount, Is.Zero); + + InputSystem.Update(); + Assert.That(InputState.updateCount, Is.EqualTo(1)); + + InputSystem.Update(); + Assert.That(InputState.updateCount, Is.EqualTo(2)); + } + + [Test] + [Category("State")] + [Ignore("TODO")] + public void TODO_State_CanGetUpdateCount_ForEditorUpdates() + { + InputSystem.Update(InputUpdateType.Editor); + Assert.That(InputState.updateCount, Is.EqualTo(1)); + } + [Test] [Category("State")] public void State_CanComputeStateLayoutFromStateStructure() @@ -892,7 +944,7 @@ partial class CoreTests { var gamepad = InputSystem.AddDevice(); - InputSystem.onEvent += eventPtr => Assert.Fail("No event should be triggered"); + InputSystem.onEvent += (e, d) => Assert.Fail("No event should be triggered"); InputState.Change(gamepad, new GamepadState {leftTrigger = 0.123f}); diff --git a/Assets/Tests/InputSystem/Plugins/EnhancedTouchTests.cs b/Assets/Tests/InputSystem/Plugins/EnhancedTouchTests.cs index 79999150a..b1adacc50 100644 --- a/Assets/Tests/InputSystem/Plugins/EnhancedTouchTests.cs +++ b/Assets/Tests/InputSystem/Plugins/EnhancedTouchTests.cs @@ -6,6 +6,7 @@ using UnityEngine; using UnityEngine.InputSystem; using UnityEngine.InputSystem.Controls; using UnityEngine.InputSystem.EnhancedTouch; +using UnityEngine.InputSystem.LowLevel; using UnityEngine.InputSystem.Utilities; using UnityEngine.TestTools.Utils; using Touch = UnityEngine.InputSystem.EnhancedTouch.Touch; diff --git a/Assets/Tests/InputSystem/Plugins/SteamTests.cs b/Assets/Tests/InputSystem/Plugins/SteamTests.cs index b9e2ebd10..e8982a056 100644 --- a/Assets/Tests/InputSystem/Plugins/SteamTests.cs +++ b/Assets/Tests/InputSystem/Plugins/SteamTests.cs @@ -175,14 +175,12 @@ internal class SteamTests : InputTestFixture { var receivedStateEvent = false; InputSystem.onEvent += - eventPtr => + (eventPtr, device) => { if (!eventPtr.IsA()) return; - var device = InputSystem.GetDeviceById(eventPtr.deviceId) as TestController; - if (device == null) + if (!(device is TestController)) return; - receivedStateEvent = true; }; diff --git a/Assets/Tests/InputSystem/Utilities/ArrayHelperTests.cs b/Assets/Tests/InputSystem/Utilities/ArrayHelperTests.cs index 64dd821b4..a395c6b7f 100644 --- a/Assets/Tests/InputSystem/Utilities/ArrayHelperTests.cs +++ b/Assets/Tests/InputSystem/Utilities/ArrayHelperTests.cs @@ -1,3 +1,4 @@ +using System.Globalization; using NUnit.Framework; using Unity.Collections; using UnityEngine.InputSystem.Utilities; diff --git a/Packages/com.unity.inputsystem/CHANGELOG.md b/Packages/com.unity.inputsystem/CHANGELOG.md index b8d03221b..f735b6349 100755 --- a/Packages/com.unity.inputsystem/CHANGELOG.md +++ b/Packages/com.unity.inputsystem/CHANGELOG.md @@ -26,6 +26,23 @@ however, it has to be formatted properly to pass verification tests. ### Changed +- The signature of `InputSystem.onEvent` has changed. The callback now takes a second argument which is the device the given event is sent to (null if there's no corresponding `InputDevice`). + ``` + // Before: + InputSystem.onEvent += + eventPtr => + { + var device = InputSystem.GetDeviceById(eventPtr.deviceId); + //... + }; + + // Now: + InputSystem.onEvent += + (eventPtr, device) => + { + //... + }; + ``` - The way input devices are built internally has been streamlined. * `InputDeviceBuilder` is now internal. It is no longer necessary to access it to look up child controls. Simply use `InputControl.GetChildControl` instead. * To build a device without adding it to the system, call the newly added `InputDevice.Build` method. @@ -33,6 +50,9 @@ however, it has to be formatted properly to pass verification tests. InputDevice.Build(); ``` * `InputSystem.SetLayoutVariant` has been removed. Layout variants can no longer be set retroactively but must be decided on as part of device creation. +#### Actions + +* `InputAction.ReadValue()` is longer correlated to `InputAction.triggered`. It simply returns the current value of a bound control or composite while the action is being interacted with. #### Actions @@ -44,6 +64,13 @@ however, it has to be formatted properly to pass verification tests. * Call `InputSystem.AddDeviceUsage(device,usage)` to add additional usages to a device. * Call `InputSystem.RemoveDeviceUsage(device,usage)` to remove existing usages from a device. * `InputSystem.SetDeviceUsage(device,usage)` still exists. It will clear all existing usages from the given device. +- A new `VisualizerSamples` sample that can be installed through the package manager. + * Contains two components `InputControlVisualizer` and `InputActionVisualizer` that help visualizing/debugging control/device and action activity through in-game overlays. A few sample scenes illustrate how to use them. + +#### Actions + +- Added `InputAction.ReadValueAsObject` API. +- Added `InputAction.activeControl` API. ## [0.9.0-preview] - 2019-7-18 diff --git a/Packages/com.unity.inputsystem/Documentation~/Debugging.md b/Packages/com.unity.inputsystem/Documentation~/Debugging.md index 94bea99ff..44f290c38 100644 --- a/Packages/com.unity.inputsystem/Documentation~/Debugging.md +++ b/Packages/com.unity.inputsystem/Documentation~/Debugging.md @@ -2,7 +2,21 @@ # Debugging -The "Input Debugger" view provides a window into the data and activity of the input system. To open the window, go to `Window >> Analysis >> Input Debugger` in Unity's main menu in the editor. +* [Input Debugger](#input-debugger) + * [Debugging Remotely](#debugging-remotely) + * [Debugging Devices](#debugging-devices) + * [Debugging Actions](#debugging-actions) + * [Debugging Users/PlayerInput](#debugging-users-playerinput) +* [Input Visualizers](#input-visualizers) + * [Visualizing Controls](#visualizing-controls) + * [Visualizing Actions](#visualizing-actions) +* [Event Diagnostics](#event-diagnostics) + +When something isn't working as expected, the best first stop is usually the "Input Debugger" in the Unity editor. This is a Unity editor window that is designed to provide access to the activity of the input system in both the editor and in connected players. + +To open the input debugger, go to `Window >> Analysis >> Input Debugger` in Unity's main menu in the editor. + +## Input Debugger ![Input Debugger](Images/InputDebugger.png) @@ -11,22 +25,44 @@ The debugger shows a tree breakdown of the state of the input system. |Item|Description| |----|-----------| |Devices|[Input devices](Devices.md) that are currently added to the system as well as a list of unsupported/unrecognized devices.| -|Layouts|| -|Actions|Only visible in play mode and only if there are [actions](Actions.md) that are currently enabled.

Shows the list of all currently enabled actions and the controls they are bound to.| -|Users|Only visible when there is one or more `InputUser` instances. See [documentation](UserManagement.md).

Lists all currently active uers along with their active control schemes and devices, all their associated actions as well as the controls they are bound to.

Note that `PlayerInput` uses `InputUser` underneath. This means that when using `PlayerInput` components, each player will have an entry here.| +|Layouts|A breakdown of all registered control and device layouts. This is essentially the database of supported hardware and the knowledge of how to represent a given piece of input hardware.| +|Actions|Only visible in play mode and only if there are [actions](Actions.md) that are currently enabled.

Shows the list of all currently enabled actions and the controls they are bound to.

See [Debugging Actions](#debugging-actions).| +|Users|Only visible when there is one or more `InputUser` instances. See [documentation](UserManagement.md).

Lists all currently active uers along with their active control schemes and devices, all their associated actions as well as the controls they are bound to.

Note that `PlayerInput` uses `InputUser` underneath. This means that when using `PlayerInput` components, each player will have an entry here.

See [Debugging Users/PlayerInput](#debugging-users-playerinput).| |Settings|| |Metrics|| -## Connecting a Player +### Debugging Remotely + +You can connect input debugger to a player running on a device. This makes input activity from the player observable in the editor. The mechanism used by this is Unity's `PlayerConnection`, i.e. the same mechanism by which the Unity profiler can be connected to a player. >NOTE: At the moment, debugging input in players is restricted to seeing devices and events from connected players. There is no support yet for seeing other input-related data from players. ////TODO: explain "Remote Devices" -## Debugging Devices +### Debugging Devices -## Debugging Actions +>NOTE: For an alternative way to debug/visualize controls and/or devices, see [Visualizing Controls](#visualizing-controls). -## Debugging Users +### Debugging Actions -## Diagnostics Mode +>NOTE: For an alternative way to debug/visualize actions, see [Visualizing Actions](#visualizing-actions). + +### Debugging Users/PlayerInput + +When there are multiple `InputUser` instances – each `PlayerInput` will implicitly create one –, the debugger will list each user along with its paired devices and active actions. + +IMAGE + +## Input Visualizers + +To debug specific problems it is often helpful to see activity over time and presented in graphical form. + +>NOTE: The input visualizer components are only available in the editor and in development players. + +### Visualizing Controls + +### Visualizing Actions + +## Event Diagnostics + +In normal operation, the input system will silently discard any anomalous input it finds in the event stream. TODO diff --git a/Packages/com.unity.inputsystem/InputSystem/Actions/InputAction.cs b/Packages/com.unity.inputsystem/InputSystem/Actions/InputAction.cs index 0b0588023..16f9d436a 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Actions/InputAction.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Actions/InputAction.cs @@ -239,7 +239,19 @@ namespace UnityEngine.InputSystem /// Whether the action was triggered (i.e. had called) this frame. /// /// + /// Unlike , which will reset when the action goes back to waiting + /// state, this property will stay true for the duration of the current frame (i.e. until the next + /// runs) as long as the action was triggered at least once. + /// + /// + /// + /// if (myControls.gameplay.fire.triggered) + /// Fire(); + /// + /// /// + /// + /// public unsafe bool triggered { get @@ -253,6 +265,32 @@ namespace UnityEngine.InputSystem } } + /// + /// The currently active control that is driving the action. Null while the action + /// is in waiting () or canceled () + /// state. Otherwise the control that last had activity on it which wasn't ignored. + /// + /// + /// Note that the control's value does not necessarily correspond to the value of the + /// action () as the control may be part of a composite. + /// + /// + public unsafe InputControl activeControl + { + get + { + var state = GetOrCreateActionMap().m_State; + if (state != null) + { + var actionStatePtr = &state.actionStates[m_ActionIndexInState]; + var controlIndex = actionStatePtr->controlIndex; + if (controlIndex != InputActionState.kInvalidIndex) + return state.controls[controlIndex]; + } + return null; + } + } + /// /// Whether the action wants a state check on its bound controls as soon as it is enabled. /// @@ -360,43 +398,99 @@ namespace UnityEngine.InputSystem /// /// Read the current value of the action. This is the last value received on , - /// , or (whichever came last) except if the action - /// is in which case must be - /// and the returned value will be 1 if is true and 0 otherwise. + /// or . If the action is in canceled or waiting phase, returns default(TValue). /// - /// Value type to read. Must match - /// + /// Value type to read. Must match the value type of the binding/control that triggered. + /// The current value of the action. + /// + /// This method can be used as an alternative to hooking into , , + /// and/or and reading out the value using + /// there. Instead, this API acts more like a polling API that can be called, for example, as part of + /// . + /// + /// + /// + /// // Let's say you have a MyControls.inputactions file with "Generate C# Class" enabled + /// // and it has an action map called "gameplay" with a "move" action of type Vector2. + /// public class MyBehavior : MonoBehaviour + /// { + /// public MyControls controls; + /// public float moveSpeed = 4; + /// + /// protected void Awake() + /// { + /// controls = new MyControls(); + /// } + /// + /// protected void OnEnable() + /// { + /// controls.gameplay.Enable(); + /// } + /// + /// protected void OnDisable() + /// { + /// controls.gameplay.Disable(); + /// } + /// + /// protected void Update() + /// { + /// var moveVector = controls.gameplay.move.ReadValue<Vector2>() * (moveSpeed * Time.deltaTime); + /// //... + /// } + /// } + /// + /// + /// + /// If the action has button-like behavior, then is usually a better alternative to + /// reading out a float and checking if it is above the button press point. + /// + /// The given type does not match + /// the value type of the control or composite currently driving the action. + /// + /// + /// public unsafe TValue ReadValue() where TValue : struct { var result = default(TValue); - if (type == InputActionType.Button) + var state = GetOrCreateActionMap().m_State; + if (state != null) { - if (typeof(TValue) != typeof(float)) - throw new InvalidOperationException( - $"Value type for Button type action {this} must be float but was {typeof(TValue).Name} instead"); - - // Working around limitations in type system to treat TValue as float here. - - var resultPtr = (float*)UnsafeUtility.AddressOf(ref result); - *resultPtr = triggered ? 1 : 0; - } - else - { - var state = GetOrCreateActionMap().m_State; - if (state != null) - { - var actionStatePtr = &state.actionStates[m_ActionIndexInState]; - var controlIndex = actionStatePtr->controlIndex; - if (controlIndex != InputActionState.kInvalidIndex) - result = state.ReadValue(actionStatePtr->bindingIndex, controlIndex); - } + var actionStatePtr = &state.actionStates[m_ActionIndexInState]; + var controlIndex = actionStatePtr->controlIndex; + if (controlIndex != InputActionState.kInvalidIndex) + result = state.ReadValue(actionStatePtr->bindingIndex, controlIndex); } return result; } + /// + /// Same as but read the value without having to know the value type + /// of the action. + /// + /// The current value of the action or null if the action is not currently in + /// or phase. + /// + /// This method allocates GC memory and is thus not a good choice for getting called as part of gameplay + /// logic. + /// + /// + public unsafe object ReadValueAsObject() + { + var state = GetOrCreateActionMap().m_State; + if (state == null) + return null; + + var actionStatePtr = &state.actionStates[m_ActionIndexInState]; + var controlIndex = actionStatePtr->controlIndex; + if (controlIndex != InputActionState.kInvalidIndex) + return state.ReadValueAsObject(actionStatePtr->bindingIndex, controlIndex); + + return null; + } + ////REVIEW: it would be best if these were InternedStrings; however, for serialization, it has to be strings [Tooltip("Human readable name of the action. Must be unique within its action map (case is ignored). Can be changed " + "without breaking references to the action.")] diff --git a/Packages/com.unity.inputsystem/InputSystem/Actions/InputActionRebindingExtensions.cs b/Packages/com.unity.inputsystem/InputSystem/Actions/InputActionRebindingExtensions.cs index 8215ac7fd..7605e5e52 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Actions/InputActionRebindingExtensions.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Actions/InputActionRebindingExtensions.cs @@ -710,17 +710,12 @@ namespace UnityEngine.InputSystem m_Flags &= ~Flags.OnEventHooked; } - private unsafe void OnEvent(InputEventPtr eventPtr) + private unsafe void OnEvent(InputEventPtr eventPtr, InputDevice device) { // Ignore if not a state event. if (!eventPtr.IsA() && !eventPtr.IsA()) return; - // Fetch device. - var device = InputSystem.GetDeviceById(eventPtr.deviceId); - if (device == null) - return; - // Go through controls and see if there's anything interesting in the event. var controls = device.allControls; var controlCount = controls.Count; @@ -1063,8 +1058,8 @@ namespace UnityEngine.InputSystem private Func m_OnGeneratePath; private Func m_OnComputeScore; private Action m_OnApplyBinding; - private Action m_OnEventDelegate; private Action m_OnAfterUpdateDelegate; + private Action m_OnEventDelegate; private InputControlLayout.Cache m_LayoutCache; private StringBuilder m_PathBuilder; private Flags m_Flags; diff --git a/Packages/com.unity.inputsystem/InputSystem/Actions/InputActionState.cs b/Packages/com.unity.inputsystem/InputSystem/Actions/InputActionState.cs index 7a9483c2b..1b84ce839 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Actions/InputActionState.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Actions/InputActionState.cs @@ -776,7 +776,7 @@ namespace UnityEngine.InputSystem InputEventPtr eventPtr, long mapControlAndBindingIndex) { #if UNITY_EDITOR - if (InputState.currentUpdate == InputUpdateType.Editor) + if (InputState.currentUpdateType == InputUpdateType.Editor) return; #endif diff --git a/Packages/com.unity.inputsystem/InputSystem/Controls/InputControlLayout.cs b/Packages/com.unity.inputsystem/InputSystem/Controls/InputControlLayout.cs index 865301e93..a363812b2 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Controls/InputControlLayout.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Controls/InputControlLayout.cs @@ -94,6 +94,7 @@ namespace UnityEngine.InputSystem.Layouts /// This field is required. /// /// + /// public InternedString name; public InternedString layout; @@ -369,6 +370,23 @@ namespace UnityEngine.InputSystem.Layouts return null; } + /// + /// Return the type of values produced by controls created from the layout. + /// + /// The value type of the control or null if it cannot be determined. + /// + /// This method only returns the statically inferred value type. This type corresponds + /// to the type argument to in the inheritance hierarchy + /// of . As the type used by the layout may not inherit from + /// , this may mean that the value type cannot be inferred + /// and the method will return null. + /// + /// + public Type GetValueType() + { + return TypeHelpers.GetGenericTypeArgumentFromHierarchy(type, typeof(InputControl<>), 0); + } + /// /// Build a layout programmatically. Primarily for use by layout builders /// registered with the system. diff --git a/Packages/com.unity.inputsystem/InputSystem/Devices/Remote/InputRemoting.cs b/Packages/com.unity.inputsystem/InputSystem/Devices/Remote/InputRemoting.cs index 3cc413908..e5fc28cc4 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Devices/Remote/InputRemoting.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Devices/Remote/InputRemoting.cs @@ -200,13 +200,11 @@ namespace UnityEngine.InputSystem Send(message); } - private unsafe void SendEvent(InputEventPtr eventPtr) + private unsafe void SendEvent(InputEventPtr eventPtr, InputDevice device) { if (m_Subscribers == null) return; - var device = m_LocalManager.TryGetDeviceById(eventPtr.deviceId); - ////REVIEW: we probably want to have better control over this and allow producing local events //// against remote devices which *are* indeed sent across the wire // Don't send events that came in from remote devices. diff --git a/Packages/com.unity.inputsystem/InputSystem/Editor/ControlPicker/InputControlPathEditor.cs b/Packages/com.unity.inputsystem/InputSystem/Editor/ControlPicker/InputControlPathEditor.cs index 485604006..cfa790f5c 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Editor/ControlPicker/InputControlPathEditor.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Editor/ControlPicker/InputControlPathEditor.cs @@ -34,6 +34,8 @@ namespace UnityEngine.InputSystem.Editor this.onModified = onModified; m_PickerState = pickerState ?? new InputControlPickerState(); + + m_PathLabel = new GUIContent(pathProperty.displayName, pathProperty.tooltip); } public void Dispose() @@ -93,7 +95,7 @@ namespace UnityEngine.InputSystem.Editor var lineRect = rect; var labelRect = lineRect; labelRect.width = EditorGUIUtility.labelWidth; - EditorGUI.LabelField(labelRect, s_PathLabel); + EditorGUI.LabelField(labelRect, m_PathLabel); lineRect.x += labelRect.width; lineRect.width -= labelRect.width; @@ -166,6 +168,7 @@ namespace UnityEngine.InputSystem.Editor public SerializedProperty pathProperty { get; } public Action onModified { get; } + private GUIContent m_PathLabel; private string m_ExpectedControlLayout; private string[] m_ControlPathsToMatch; private InputControlScheme[] m_ControlSchemes; @@ -174,8 +177,6 @@ namespace UnityEngine.InputSystem.Editor private InputControlPickerDropdown m_PickerDropdown; private readonly InputControlPickerState m_PickerState; private InputActionRebindingExtensions.RebindingOperation m_RebindingOperation; - - private static readonly GUIContent s_PathLabel = EditorGUIUtility.TrTextContent("Path", "Path of the controls that will be bound to the action at runtime."); } } #endif // UNITY_EDITOR diff --git a/Packages/com.unity.inputsystem/InputSystem/Editor/Debugger/InputDeviceDebuggerWindow.cs b/Packages/com.unity.inputsystem/InputSystem/Editor/Debugger/InputDeviceDebuggerWindow.cs index c4eacce4c..7861b8d19 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Editor/Debugger/InputDeviceDebuggerWindow.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Editor/Debugger/InputDeviceDebuggerWindow.cs @@ -248,7 +248,7 @@ namespace UnityEngine.InputSystem.Editor private void RefreshControlTreeValues() { var updateTypeToShow = InputSystem.s_Manager.defaultUpdateType; - var currentUpdateType = InputState.currentUpdate; + var currentUpdateType = InputState.currentUpdateType; InputStateBuffers.SwitchTo(InputSystem.s_Manager.m_StateBuffers, updateTypeToShow); m_ControlTree.RefreshControlValues(); @@ -316,7 +316,7 @@ namespace UnityEngine.InputSystem.Editor //// input update, there is no current EditorWindow so no window to be relative to. However, even if we read the //// values in OnGUI(), the result would always be relative to the debugger window (that'd probably be fine). - if (InputState.currentUpdate != InputSystem.s_Manager.defaultUpdateType) + if (InputState.currentUpdateType != InputSystem.s_Manager.defaultUpdateType) return; m_ControlTree?.RefreshControlValues(); Repaint(); diff --git a/Packages/com.unity.inputsystem/InputSystem/Events/InputEventTrace.cs b/Packages/com.unity.inputsystem/InputSystem/Events/InputEventTrace.cs index a2a172ff5..a2bbfce72 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Events/InputEventTrace.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Events/InputEventTrace.cs @@ -166,7 +166,7 @@ namespace UnityEngine.InputSystem.LowLevel m_EventBufferTail = IntPtr.Zero; } - private unsafe void OnInputEvent(InputEventPtr inputEvent) + private unsafe void OnInputEvent(InputEventPtr inputEvent, InputDevice device) { // Ignore if the event isn't for our device. if (m_DeviceId != InputDevice.InvalidDeviceId && inputEvent.deviceId != m_DeviceId) diff --git a/Packages/com.unity.inputsystem/InputSystem/InputManager.cs b/Packages/com.unity.inputsystem/InputSystem/InputManager.cs index 98ece31d9..edc172a66 100644 --- a/Packages/com.unity.inputsystem/InputSystem/InputManager.cs +++ b/Packages/com.unity.inputsystem/InputSystem/InputManager.cs @@ -41,8 +41,8 @@ namespace UnityEngine.InputSystem using DeviceChangeListener = Action; using DeviceStateChangeListener = Action; using LayoutChangeListener = Action; - using EventListener = Action; using UpdateListener = Action; + using EventListener = Action; /// /// Hub of the input system. @@ -2358,8 +2358,11 @@ namespace UnityEngine.InputSystem var listenerCount = m_EventListeners.length; if (listenerCount > 0) { + if (device == null) + device = TryGetDeviceById(currentEventReadPtr->deviceId); + for (var i = 0; i < listenerCount; ++i) - m_EventListeners[i](new InputEventPtr(currentEventReadPtr)); + m_EventListeners[i](new InputEventPtr(currentEventReadPtr), device); // If a listener marks the event as handled, we don't process it further. if (currentEventReadPtr->handled) @@ -2372,7 +2375,7 @@ namespace UnityEngine.InputSystem // Grab device for event. In before-render updates, we already had to // check the device. - if (!isBeforeRenderUpdate) + if (device == null) device = TryGetDeviceById(currentEventReadPtr->deviceId); if (device == null) { diff --git a/Packages/com.unity.inputsystem/InputSystem/InputSystem.cs b/Packages/com.unity.inputsystem/InputSystem/InputSystem.cs index 59a671864..971fe6e0c 100644 --- a/Packages/com.unity.inputsystem/InputSystem/InputSystem.cs +++ b/Packages/com.unity.inputsystem/InputSystem/InputSystem.cs @@ -1299,7 +1299,64 @@ namespace UnityEngine.InputSystem #region Events - public static event Action onEvent + /// + /// Called during for each event that is processed. + /// + /// + /// Every time the input system updates (see + /// or for details about when and how this happens), + /// it flushes all events from the internal event buffer that are due in the current + /// update ( for details about when events + /// may be postponed to a subsequent frame). + /// + /// As the input system reads events from the buffer one by one, it will trigger this + /// callback for each event before then proceeding to process the event. However, if + /// any of the callbacks sets to true, the event will + /// be skipped and ignored. + /// + /// Note that the input system does NOT sort events by timestamps (). + /// Instead, they are consumed in the order they are produced. This means that they + /// will also surface on this callback in that order. + /// + /// Note that the callback will be called for any event picked up from the internal + /// event buffer. This may include events for devices that have not been created and thus + /// may mean that the parameter to the callback is null. + /// + /// + /// + /// // Treat left+right mouse button as middle mouse button. + /// // (Note: This example is more for demonstrative purposes; it isn't necessarily a good use case) + /// InputSystem.onEvent += + /// (eventPtr, device) => + /// { + /// // Only deal with state events. + /// if (!eventPtr.IsA<StateEvent>()) + /// return; + /// + /// if (!(device is Mouse mouse)) + /// return; + /// + /// mouse.leftButton.ReadValueFromEvent(eventPtr, out var lmbDown); + /// mouse.rightButton.ReadValueFromEvent(eventPtr, out var rmbDown); + /// + /// if (lmbDown > 0 && rmbDown > 0) + /// mouse.middleButton.WriteValueIntoEvent(1f, eventPtr); + /// }; + /// + /// + /// + /// If you are looking for a way to capture events, may be of + /// interest and an alternative to directly hooking into this event. + /// + /// If you are looking to monitor changes to specific input controls, state change monitors + /// (see + /// are usually a more efficient and convenient way to set this up. + /// + /// + /// + /// + /// + public static event Action onEvent { add => s_Manager.onEvent += value; remove => s_Manager.onEvent -= value; diff --git a/Packages/com.unity.inputsystem/InputSystem/Plugins/EnhancedTouch/TouchSimulation.cs b/Packages/com.unity.inputsystem/InputSystem/Plugins/EnhancedTouch/TouchSimulation.cs index f9b98fb2b..f050cfe03 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Plugins/EnhancedTouch/TouchSimulation.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Plugins/EnhancedTouch/TouchSimulation.cs @@ -28,7 +28,7 @@ namespace UnityEngine.InputSystem.EnhancedTouch /// Adds a with input simulated from other types of devices (e.g. /// or ). /// - [AddComponentMenu("Input/Touch Simulation")] + [AddComponentMenu("Input/Debug/Touch Simulation")] [ExecuteInEditMode] #if UNITY_EDITOR [InitializeOnLoad] diff --git a/Packages/com.unity.inputsystem/InputSystem/State/InputState.cs b/Packages/com.unity.inputsystem/InputSystem/State/InputState.cs index b2926755b..bab75c393 100644 --- a/Packages/com.unity.inputsystem/InputSystem/State/InputState.cs +++ b/Packages/com.unity.inputsystem/InputSystem/State/InputState.cs @@ -22,7 +22,13 @@ namespace UnityEngine.InputSystem.LowLevel /// that queries input state will receive. For example, during editor updates, this will be /// and the state buffers for the editor will be active. /// - public static InputUpdateType currentUpdate => InputUpdate.s_LastUpdateType; + public static InputUpdateType currentUpdateType => InputUpdate.s_LastUpdateType; + + ////FIXME: ATM this does not work for editor updates + /// + /// The number of times the current input state has been updated. + /// + public static uint updateCount => InputUpdate.s_UpdateStepCount; public static double currentTime => InputRuntime.s_Instance.currentTime + InputRuntime.s_CurrentTimeOffsetToRealtimeSinceStartup; diff --git a/Packages/com.unity.inputsystem/InputSystem/State/InputStateHistory.cs b/Packages/com.unity.inputsystem/InputSystem/State/InputStateHistory.cs index eeb38209c..cc5699b15 100644 --- a/Packages/com.unity.inputsystem/InputSystem/State/InputStateHistory.cs +++ b/Packages/com.unity.inputsystem/InputSystem/State/InputStateHistory.cs @@ -372,7 +372,7 @@ namespace UnityEngine.InputSystem.LowLevel InputEventPtr eventPtr, long monitorIndex) { // Ignore state change if it's in an input update we're not interested in. - var currentUpdateType = InputState.currentUpdate; + var currentUpdateType = InputState.currentUpdateType; var updateTypeMask = updateMask; if ((currentUpdateType & updateTypeMask) == 0 && // EXCEPTION: When we're recording fixed and/or dynamic updates, do NOT ignore the state change diff --git a/Packages/com.unity.inputsystem/InputSystem/Utilities/PrimitiveValue.cs b/Packages/com.unity.inputsystem/InputSystem/Utilities/PrimitiveValue.cs index 727aa6aa7..4cbdbc2bd 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Utilities/PrimitiveValue.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Utilities/PrimitiveValue.cs @@ -3,11 +3,18 @@ using System.Globalization; using System.Runtime.InteropServices; using Unity.Collections.LowLevel.Unsafe; +////REVIEW: add Vector2 and Vector3 as primitive value types? + namespace UnityEngine.InputSystem.Utilities { /// /// A union holding a primitive value. /// + /// + /// This structure is used for storing things such as default values for controls + /// (see ). It can + /// store one value of any primitive, non-reference C# type (bool, char, int, float, etc). + /// [StructLayout(LayoutKind.Explicit)] public struct PrimitiveValue : IEquatable, IConvertible { @@ -25,10 +32,15 @@ namespace UnityEngine.InputSystem.Utilities [FieldOffset(4)] private float m_FloatValue; [FieldOffset(4)] private double m_DoubleValue; + /// + /// Type of value stored in the struct. + /// if the struct does not hold a value (i.e. has been default-initialized). + /// public TypeCode type => m_Type; /// - /// If true, the struct does not contain a primitive value. + /// If true, the struct does not contain a primitive value (i.e. has + /// ). /// public bool isEmpty => type == TypeCode.Empty; @@ -293,7 +305,7 @@ namespace UnityEngine.InputSystem.Utilities case TypeCode.Double: return NumberHelpers.Approximately(m_DoubleValue, 0); default: - return default(bool); + return default; } } @@ -316,7 +328,7 @@ namespace UnityEngine.InputSystem.Utilities case TypeCode.UInt64: return (char)ToInt64(provider); default: - return default(char); + return default; } } @@ -361,7 +373,7 @@ namespace UnityEngine.InputSystem.Utilities case TypeCode.Double: return m_DoubleValue; default: - return default(double); + return default; } } @@ -471,7 +483,7 @@ namespace UnityEngine.InputSystem.Utilities case TypeCode.Double: return (ulong)m_DoubleValue; default: - return default(ulong); + return default; } } diff --git a/Packages/com.unity.inputsystem/InputSystem/Utilities/TypeHelpers.cs b/Packages/com.unity.inputsystem/InputSystem/Utilities/TypeHelpers.cs index c63ebfe1b..83e4075b2 100644 --- a/Packages/com.unity.inputsystem/InputSystem/Utilities/TypeHelpers.cs +++ b/Packages/com.unity.inputsystem/InputSystem/Utilities/TypeHelpers.cs @@ -126,7 +126,6 @@ namespace UnityEngine.InputSystem.Utilities } } - return type.GenericTypeArguments[argumentIndex]; } } diff --git a/Packages/manifest.json b/Packages/manifest.json index 33fd4665a..c34f43598 100644 --- a/Packages/manifest.json +++ b/Packages/manifest.json @@ -1,47 +1,47 @@ -{ - "dependencies": { - "com.unity.ads": "2.0.8", - "com.unity.analytics": "3.3.2", - "com.unity.cinemachine": "2.3.4", - "com.unity.modules.ai": "1.0.0", - "com.unity.modules.animation": "1.0.0", - "com.unity.modules.assetbundle": "1.0.0", - "com.unity.modules.audio": "1.0.0", - "com.unity.modules.cloth": "1.0.0", - "com.unity.modules.director": "1.0.0", - "com.unity.modules.imageconversion": "1.0.0", - "com.unity.modules.imgui": "1.0.0", - "com.unity.modules.jsonserialize": "1.0.0", - "com.unity.modules.particlesystem": "1.0.0", - "com.unity.modules.physics": "1.0.0", - "com.unity.modules.physics2d": "1.0.0", - "com.unity.modules.screencapture": "1.0.0", - "com.unity.modules.terrain": "1.0.0", - "com.unity.modules.terrainphysics": "1.0.0", - "com.unity.modules.tilemap": "1.0.0", - "com.unity.modules.ui": "1.0.0", - "com.unity.modules.uielements": "1.0.0", - "com.unity.modules.umbra": "1.0.0", - "com.unity.modules.unityanalytics": "1.0.0", - "com.unity.modules.unitywebrequest": "1.0.0", - "com.unity.modules.unitywebrequestassetbundle": "1.0.0", - "com.unity.modules.unitywebrequestaudio": "1.0.0", - "com.unity.modules.unitywebrequesttexture": "1.0.0", - "com.unity.modules.unitywebrequestwww": "1.0.0", - "com.unity.modules.vehicles": "1.0.0", - "com.unity.modules.video": "1.0.0", - "com.unity.modules.vr": "1.0.0", - "com.unity.modules.wind": "1.0.0", - "com.unity.modules.xr": "1.0.0", - "com.unity.multiplayer-hlapi": "1.0.2", - "com.unity.package-manager-doctools": "1.1.0-preview.1", - "com.unity.package-manager-ui": "2.1.2", - "com.unity.probuilder": "4.0.5", - "com.unity.purchasing": "2.0.6", - "com.unity.textmeshpro": "2.0.0", - "com.unity.timeline": "1.0.0", - "com.unity.xr.legacyinputhelpers": "2.0.2", - "nuget.mono-cecil": "0.1.5-preview" - }, - "registry": "https://staging-packages.unity.com" -} +{ + "dependencies": { + "com.unity.ads": "2.0.8", + "com.unity.analytics": "3.3.2", + "com.unity.cinemachine": "2.3.4", + "com.unity.multiplayer-hlapi": "1.0.2", + "com.unity.package-manager-doctools": "1.1.1-preview.1", + "com.unity.package-manager-ui": "2.1.2", + "com.unity.probuilder": "4.0.5", + "com.unity.purchasing": "2.0.6", + "com.unity.textmeshpro": "2.0.1", + "com.unity.timeline": "1.0.0", + "com.unity.xr.legacyinputhelpers": "2.0.2", + "nuget.mono-cecil": "0.1.5-preview", + "com.unity.modules.ai": "1.0.0", + "com.unity.modules.animation": "1.0.0", + "com.unity.modules.assetbundle": "1.0.0", + "com.unity.modules.audio": "1.0.0", + "com.unity.modules.cloth": "1.0.0", + "com.unity.modules.director": "1.0.0", + "com.unity.modules.imageconversion": "1.0.0", + "com.unity.modules.imgui": "1.0.0", + "com.unity.modules.jsonserialize": "1.0.0", + "com.unity.modules.particlesystem": "1.0.0", + "com.unity.modules.physics": "1.0.0", + "com.unity.modules.physics2d": "1.0.0", + "com.unity.modules.screencapture": "1.0.0", + "com.unity.modules.terrain": "1.0.0", + "com.unity.modules.terrainphysics": "1.0.0", + "com.unity.modules.tilemap": "1.0.0", + "com.unity.modules.ui": "1.0.0", + "com.unity.modules.uielements": "1.0.0", + "com.unity.modules.umbra": "1.0.0", + "com.unity.modules.unityanalytics": "1.0.0", + "com.unity.modules.unitywebrequest": "1.0.0", + "com.unity.modules.unitywebrequestassetbundle": "1.0.0", + "com.unity.modules.unitywebrequestaudio": "1.0.0", + "com.unity.modules.unitywebrequesttexture": "1.0.0", + "com.unity.modules.unitywebrequestwww": "1.0.0", + "com.unity.modules.vehicles": "1.0.0", + "com.unity.modules.video": "1.0.0", + "com.unity.modules.vr": "1.0.0", + "com.unity.modules.wind": "1.0.0", + "com.unity.modules.xr": "1.0.0" + }, + "registry": "https://staging-packages.unity.com" +}