NEW: Add sample with components for visualizing control and action activity (#754).

This commit is contained in:
Rene Damm 2019-08-06 13:40:04 +02:00 коммит произвёл GitHub
Родитель bbd15b22b6
Коммит 92fb39bf3a
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
58 изменённых файлов: 6445 добавлений и 170 удалений

Просмотреть файл

@ -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 }}

Просмотреть файл

@ -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;

8
Assets/Samples.meta Normal file
Просмотреть файл

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 8e73f6bdc238e41a4a18c59f74a12f77
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Просмотреть файл

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 82c13d32934f84c798213f0a5854afec
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Просмотреть файл

@ -0,0 +1,4 @@
{
"displayName": "Visualizer Samples",
"description": "Examples for setting up input control and action visualizations."
}

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: b8429651427a640919754290f3704312
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Просмотреть файл

@ -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}

Просмотреть файл

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 60155d44a3f544d08a44a9fa0b5e2c4e
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Просмотреть файл

@ -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
{
/// <summary>
/// A component for debugging purposes that adds an on-screen display which shows
/// activity on an input action over time (<see cref="InputActionVisualizer.Visualization.Interaction"/>)
/// or an action's current value (<see cref="InputActionVisualizer.Visualization.Value"/>).
/// </summary>
/// <seealso cref="InputControlVisualizer"/>
[AddComponentMenu("Input/Debug/Input Action Visualizer")]
[ExecuteInEditMode]
public class InputActionVisualizer : InputVisualizer
{
/// <summary>
/// The action that is being visualized. May be null.
/// </summary>
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<InputActionVisualizer>();
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<float>
{
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<float>
{
limitMax = 1
};
else if (valueType == typeof(int))
m_Visualizer = new VisualizationHelpers.ScalarVisualizer<int>
{
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<InputActionVisualizer> 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,
}
}
}

Просмотреть файл

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 939ce9f3839b54466af594f7854ed222
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

Просмотреть файл

@ -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
{
/// <summary>
/// A component for debugging purposes that adds an on-screen display which shows
/// activity on an input control over time.
/// </summary>
/// <remarks>
/// This component is most useful for debugging input directly on the source device.
/// </remarks>
/// <seealso cref="InputActionVisualizer"/>
[AddComponentMenu("Input/Debug/Input Control Visualizer")]
[ExecuteInEditMode]
public class InputControlVisualizer : InputVisualizer
{
/// <summary>
/// What kind of visualization to show.
/// </summary>
public Mode visualization
{
get => m_Visualization;
set
{
if (m_Visualization == value)
return;
m_Visualization = value;
SetupVisualizer();
}
}
/// <summary>
/// Path of the control that is to be visualized.
/// </summary>
/// <seealso cref="InputControlPath"/>
/// <seealso cref="InputControl.path"/>
public string controlPath
{
get => m_ControlPath;
set
{
m_ControlPath = value;
if (m_Control != null)
ResolveControl();
}
}
/// <summary>
/// If, at runtime, multiple controls are matching <see cref="controlPath"/>, this property
/// determines the index of the control that is retrieved from the possible options.
/// </summary>
public int controlIndex
{
get => m_ControlIndex;
set
{
m_ControlIndex = value;
if (m_Control != null)
ResolveControl();
}
}
/// <summary>
/// The control resolved from <see cref="controlPath"/> at runtime. May be null.
/// </summary>
public InputControl control => m_Control;
protected new void OnEnable()
{
if (m_Visualization == Mode.None)
return;
if (s_EnabledInstances == null)
s_EnabledInstances = new List<InputControlVisualizer>();
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<InputControlVisualizer> 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<float>(m_HistorySamples)
{
////TODO: pass actual min/max limits of control
limitMax = 1,
limitMin = 0
};
else if (valueType == typeof(int))
m_Visualizer = new VisualizationHelpers.ScalarVisualizer<int>(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<StateEvent>() && !eventPtr.IsA<DeltaStateEvent>())
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;
}
}
}
/// <summary>
/// Determines which aspect of the control should be visualized.
/// </summary>
public enum Mode
{
None = 0,
Value = 1,
Events = 4,
MaximumLag = 6,
Bytes = 7,
}
}
}

Просмотреть файл

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 50c7363fac4d24ae8a679e3e8f1fa838
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

Просмотреть файл

@ -0,0 +1,80 @@
using System;
namespace UnityEngine.InputSystem.Samples
{
/// <summary>
/// Base class for <see cref="InputActionVisualizer"/> and <see cref="InputControlVisualizer"/>.
/// Not meant to be extended outside of input system.
/// </summary>
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<InputControlVisualizer>();
}
[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;
}
}

Просмотреть файл

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 55e8b429cfd654e2f89f16b18d99cf4b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

Просмотреть файл

@ -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: <Mouse>/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: <Mouse>/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: <Mouse>/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: <Mouse>
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: <Mouse>
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: <Mouse>/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: <Mouse>/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: <Mouse>/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: <Mouse>
m_ControlIndex: 0

Просмотреть файл

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 76c62aa07f01945d4b9afdb34d7a3396
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Просмотреть файл

@ -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}

Просмотреть файл

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: fef3f56dbc5ed42a08528b798af41a4e
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Просмотреть файл

@ -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: <Pen>/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: <Pen>/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: <Pen>
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: <Pen>/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: <Pen>
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: <Pen>/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: <Pen>/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: <Pen>/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: <Pen>
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: <Pen>/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: <Pen>/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: <Pen>/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: <Pen>/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: <Pen>/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: <Pen>/barrel3
m_ControlIndex: 0

Просмотреть файл

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 15e76881a88c849388ecd62eb8a05750
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Просмотреть файл

@ -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}

Просмотреть файл

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: e35258e8d9ecf4a17b799d42b5ace6f3
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Просмотреть файл

@ -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": "<SteamDemoController>/fire",
"interactions": "",
"processors": "",
"groups": "",
"action": "fire",
"isComposite": false,
"isPartOfComposite": false
},
{
"name": "",
"id": "e1b8c4dd-7b3a-4db6-a93a-0889b59b1afc",
"path": "<Gamepad>/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": "<Keyboard>/w",
"interactions": "",
"processors": "",
"groups": "",
"action": "move",
"isComposite": false,
"isPartOfComposite": true
},
{
"name": "down",
"id": "f0ec75cb-f02c-40d2-a33f-1fd6eab2ae0b",
"path": "<Keyboard>/s",
"interactions": "",
"processors": "",
"groups": "",
"action": "move",
"isComposite": false,
"isPartOfComposite": true
},
{
"name": "left",
"id": "21fe6bfe-4721-4483-9f4a-a0031ade105c",
"path": "<Keyboard>/a",
"interactions": "",
"processors": "",
"groups": "",
"action": "move",
"isComposite": false,
"isPartOfComposite": true
},
{
"name": "right",
"id": "2dd39746-c75c-4a11-838a-e59eacaf4e0b",
"path": "<Keyboard>/d",
"interactions": "",
"processors": "",
"groups": "",
"action": "move",
"isComposite": false,
"isPartOfComposite": true
},
{
"name": "",
"id": "f96cc25e-7a56-479c-b093-65340e94c1ab",
"path": "<SteamDemoController>/move",
"interactions": "",
"processors": "",
"groups": "",
"action": "move",
"isComposite": false,
"isPartOfComposite": false
},
{
"name": "",
"id": "c106d6e6-2780-47ff-b318-396171bd54cc",
"path": "<Gamepad>/rightStick",
"interactions": "",
"processors": "",
"groups": "",
"action": "look",
"isComposite": false,
"isPartOfComposite": false
},
{
"name": "",
"id": "578caa03-6827-4797-adfc-a59770c437fe",
"path": "<Pointer>/delta",
"interactions": "",
"processors": "ScaleVector2(x=2,y=2)",
"groups": "",
"action": "look",
"isComposite": false,
"isPartOfComposite": false
},
{
"name": "",
"id": "f93b4751-8811-456b-8827-af4eb2cf5fab",
"path": "<SteamDemoController>/look",
"interactions": "",
"processors": "",
"groups": "",
"action": "look",
"isComposite": false,
"isPartOfComposite": false
}
]
}
],
"controlSchemes": []
}

Просмотреть файл

@ -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:

Просмотреть файл

@ -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

Просмотреть файл

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: cd3e0c715b35445fbb238f50ba9c9332
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Просмотреть файл

@ -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}

Просмотреть файл

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 14281ec1c6daa42bc97c543e027b5839
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Просмотреть файл

@ -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<TValue> : Visualizer
where TValue : struct
{
public RingBuffer<TValue> samples;
public RingBuffer<GUIContent> samplesText;
protected ValueVisualizer(int numSamples = 10)
{
samples = new RingBuffer<TValue>(numSamples);
samplesText = new RingBuffer<GUIContent>(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<TValue> : ValueVisualizer<TValue>
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<Vector2>
{
// 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<FrameSample>(historyDepth);
else
timeline.timeSamples = new RingBuffer<TimeSample>(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<TimeSample> timeSamples;
public RingBuffer<FrameSample> 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<TValue>
{
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];
}
}
}
}
}

Просмотреть файл

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: ad5cfc4797aad4aa1b10dc648646ba5e
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

Просмотреть файл

@ -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<Gamepad>();
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

Просмотреть файл

@ -581,6 +581,10 @@ partial class CoreTests
Assert.That(stickAction.ReadValue<Vector2>(),
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<Vector2>(),
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<Vector2>(),
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<float>(), Is.EqualTo(0).Within(0.00001));
Assert.That(buttonAction.ReadValue<float>(), Is.EqualTo(1).Within(0.00001));
Assert.That(triggerAction.ReadValue<float>(), Is.EqualTo(0.234).Within(0.00001));
Assert.That(stickAction.ReadValue<Vector2>(),
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<Vector2>(),
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<Gamepad>();
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()

Просмотреть файл

@ -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);

Просмотреть файл

@ -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();

Просмотреть файл

@ -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<InputEvent>();
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<InputEvent>();
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<Gamepad>();
var receivedCalls = 0;
InputSystem.onEvent += inputEvent =>
InputSystem.onEvent += (inputEvent, _) =>
{
++receivedCalls;
Assert.That(inputEvent.IsA<StateEvent>(), 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<Mouse>();
InputSystem.onEvent +=
eventPtr =>
(eventPtr, _) =>
{
// For every control that isn't contained in a state event, GetStatePtrFromStateEvent() should
// return IntPtr.Zero.

Просмотреть файл

@ -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<Gamepad>();
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});

Просмотреть файл

@ -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;

Просмотреть файл

@ -175,14 +175,12 @@ internal class SteamTests : InputTestFixture
{
var receivedStateEvent = false;
InputSystem.onEvent +=
eventPtr =>
(eventPtr, device) =>
{
if (!eventPtr.IsA<StateEvent>())
return;
var device = InputSystem.GetDeviceById(eventPtr.deviceId) as TestController;
if (device == null)
if (!(device is TestController))
return;
receivedStateEvent = true;
};

Просмотреть файл

@ -1,3 +1,4 @@
using System.Globalization;
using NUnit.Framework;
using Unity.Collections;
using UnityEngine.InputSystem.Utilities;

Просмотреть файл

@ -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<Mouse>();
```
* `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<TValue>()` 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

Просмотреть файл

@ -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.<br><br>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).<br><br>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.<br><br>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.<br><br>Shows the list of all currently enabled actions and the controls they are bound to.<br><br>See [Debugging Actions](#debugging-actions).|
|Users|Only visible when there is one or more `InputUser` instances. See [documentation](UserManagement.md).<br><br>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.<br><br>Note that `PlayerInput` uses `InputUser` underneath. This means that when using `PlayerInput` components, each player will have an entry here.<br><br>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 &ndash; each `PlayerInput` will implicitly create one &ndash;, 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

Просмотреть файл

@ -239,7 +239,19 @@ namespace UnityEngine.InputSystem
/// Whether the action was triggered (i.e. had <see cref="performed"/> called) this frame.
/// </summary>
/// <remarks>
/// Unlike <see cref="ReadValue{TValue}"/>, 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
/// <see cref="InputSystem.Update"/> runs) as long as the action was triggered at least once.
///
/// <example>
/// <code>
/// if (myControls.gameplay.fire.triggered)
/// Fire();
/// </code>
/// </example>
/// </remarks>
/// <seealso cref="InputActionType.Button"/>
/// <seealso cref="ReadValue{TValue}"/>
public unsafe bool triggered
{
get
@ -253,6 +265,32 @@ namespace UnityEngine.InputSystem
}
}
/// <summary>
/// The currently active control that is driving the action. Null while the action
/// is in waiting (<see cref="InputActionPhase.Waiting"/>) or canceled (<see cref="InputActionPhase.Canceled"/>)
/// state. Otherwise the control that last had activity on it which wasn't ignored.
/// </summary>
/// <remarks>
/// Note that the control's value does not necessarily correspond to the value of the
/// action (<see cref="ReadValue{TValue}"/>) as the control may be part of a composite.
/// </remarks>
/// <seealso cref="CallbackContext.control"/>
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;
}
}
/// <summary>
/// Whether the action wants a state check on its bound controls as soon as it is enabled.
/// </summary>
@ -360,43 +398,99 @@ namespace UnityEngine.InputSystem
/// <summary>
/// Read the current value of the action. This is the last value received on <see cref="started"/>,
/// <see cref="performed"/>, or <see cref="canceled"/> (whichever came last) except if the action <see cref="type"/>
/// is <see cref="InputActionType.Button"/> in which case <typeparamref name="TValue"/> must be <see cref="float"/>
/// and the returned value will be 1 if <see cref="triggered"/> is true and 0 otherwise.
/// or <see cref="performed"/>. If the action is in canceled or waiting phase, returns default(TValue).
/// </summary>
/// <typeparam name="TValue">Value type to read. Must match </typeparam>
/// <returns></returns>
/// <typeparam name="TValue">Value type to read. Must match the value type of the binding/control that triggered.</typeparam>
/// <returns>The current value of the action.</returns>
/// <remarks>
/// This method can be used as an alternative to hooking into <see cref="started"/>, <see cref="performed"/>,
/// and/or <see cref="canceled"/> and reading out the value using <see cref="CallbackContext.ReadValue{TValue}"/>
/// there. Instead, this API acts more like a polling API that can be called, for example, as part of
/// <see cref="MonoBehaviour.Update"/>.
///
/// <example>
/// <code>
/// // 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&lt;Vector2&gt;() * (moveSpeed * Time.deltaTime);
/// //...
/// }
/// }
/// </code>
/// </example>
///
/// If the action has button-like behavior, then <see cref="triggered"/> is usually a better alternative to
/// reading out a float and checking if it is above the button press point.
/// </remarks>
/// <exception cref="InvalidOperationException">The given <typeparamref name="TValue"/> type does not match
/// the value type of the control or composite currently driving the action.</exception>
/// <seealso cref="triggered"/>
/// <seealso cref="ReadValueAsObject"/>
/// <seealso cref="CallbackContext.ReadValue{TValue}"/>
public unsafe TValue ReadValue<TValue>()
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<TValue>(actionStatePtr->bindingIndex, controlIndex);
}
var actionStatePtr = &state.actionStates[m_ActionIndexInState];
var controlIndex = actionStatePtr->controlIndex;
if (controlIndex != InputActionState.kInvalidIndex)
result = state.ReadValue<TValue>(actionStatePtr->bindingIndex, controlIndex);
}
return result;
}
/// <summary>
/// Same as <see cref="ReadValue{TValue}"/> but read the value without having to know the value type
/// of the action.
/// </summary>
/// <returns>The current value of the action or null if the action is not currently in <see cref="InputActionPhase.Started"/>
/// or <see cref="InputActionPhase.Performed"/> phase.</returns>
/// <remarks>
/// This method allocates GC memory and is thus not a good choice for getting called as part of gameplay
/// logic.
/// </remarks>
/// <seealso cref="ReadValue{TValue}"/>
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.")]

Просмотреть файл

@ -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<StateEvent>() && !eventPtr.IsA<DeltaStateEvent>())
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<InputControl, string> m_OnGeneratePath;
private Func<InputControl, InputEventPtr, float> m_OnComputeScore;
private Action<RebindingOperation, string> m_OnApplyBinding;
private Action<InputEventPtr> m_OnEventDelegate;
private Action<InputUpdateType> m_OnAfterUpdateDelegate;
private Action<InputEventPtr, InputDevice> m_OnEventDelegate;
private InputControlLayout.Cache m_LayoutCache;
private StringBuilder m_PathBuilder;
private Flags m_Flags;

Просмотреть файл

@ -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

Просмотреть файл

@ -94,6 +94,7 @@ namespace UnityEngine.InputSystem.Layouts
/// This field is required.
/// </remarks>
/// <seealso cref="isModifyingChildControlByPath"/>
/// <seealso cref="InputControlAttribute.name"/>
public InternedString name;
public InternedString layout;
@ -369,6 +370,23 @@ namespace UnityEngine.InputSystem.Layouts
return null;
}
/// <summary>
/// Return the type of values produced by controls created from the layout.
/// </summary>
/// <returns>The value type of the control or null if it cannot be determined.</returns>
/// <remarks>
/// This method only returns the statically inferred value type. This type corresponds
/// to the type argument to <see cref="InputControl{TValue}"/> in the inheritance hierarchy
/// of <see cref="type"/>. As the type used by the layout may not inherit from
/// <see cref="InputControl{TValue}"/>, this may mean that the value type cannot be inferred
/// and the method will return null.
/// </remarks>
/// <seealso cref="InputControl.valueType"/>
public Type GetValueType()
{
return TypeHelpers.GetGenericTypeArgumentFromHierarchy(type, typeof(InputControl<>), 0);
}
/// <summary>
/// Build a layout programmatically. Primarily for use by layout builders
/// registered with the system.

Просмотреть файл

@ -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.

Просмотреть файл

@ -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

Просмотреть файл

@ -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();

Просмотреть файл

@ -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)

Просмотреть файл

@ -41,8 +41,8 @@ namespace UnityEngine.InputSystem
using DeviceChangeListener = Action<InputDevice, InputDeviceChange>;
using DeviceStateChangeListener = Action<InputDevice>;
using LayoutChangeListener = Action<string, InputControlLayoutChange>;
using EventListener = Action<InputEventPtr>;
using UpdateListener = Action<InputUpdateType>;
using EventListener = Action<InputEventPtr, InputDevice>;
/// <summary>
/// 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)
{

Просмотреть файл

@ -1299,7 +1299,64 @@ namespace UnityEngine.InputSystem
#region Events
public static event Action<InputEventPtr> onEvent
/// <summary>
/// Called during <see cref="InputSystem.Update"/> for each event that is processed.
/// </summary>
/// <remarks>
/// Every time the input system updates (see <see cref="InputSettings.updateMode"/>
/// or <see cref="InputSystem.Update"/> for details about when and how this happens),
/// it flushes all events from the internal event buffer that are due in the current
/// update (<see cref="InputSettings.timesliceEvents"/> 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 <see cref="InputEvent.handled"/> to true, the event will
/// be skipped and ignored.
///
/// Note that the input system does NOT sort events by timestamps (<see cref="InputEvent.time"/>).
/// 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 <see cref="InputDevice"/> parameter to the callback is null.
///
/// <example>
/// <code>
/// // 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&lt;StateEvent&gt;())
/// 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);
/// };
/// </code>
/// </example>
///
/// If you are looking for a way to capture events, <see cref="InputEventTrace"/> 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 <see cref="InputState.AddChangeMonitor(InputControl,IInputStateChangeMonitor,long)"/>
/// are usually a more efficient and convenient way to set this up.
/// </remarks>
/// <seealso cref="QueueEvent(InputEventPtr)"/>
/// <seealso cref="InputEvent"/>
/// <seealso cref="Update()"/>
/// <seealso cref="InputSettings.updateMode"/>
public static event Action<InputEventPtr, InputDevice> onEvent
{
add => s_Manager.onEvent += value;
remove => s_Manager.onEvent -= value;

Просмотреть файл

@ -28,7 +28,7 @@ namespace UnityEngine.InputSystem.EnhancedTouch
/// Adds a <see cref="Touchscreen"/> with input simulated from other types of <see cref="Pointer"/> devices (e.g. <see cref="Mouse"/>
/// or <see cref="Pen"/>).
/// </summary>
[AddComponentMenu("Input/Touch Simulation")]
[AddComponentMenu("Input/Debug/Touch Simulation")]
[ExecuteInEditMode]
#if UNITY_EDITOR
[InitializeOnLoad]

Просмотреть файл

@ -22,7 +22,13 @@ namespace UnityEngine.InputSystem.LowLevel
/// that queries input state will receive. For example, during editor updates, this will be
/// <see cref="InputUpdateType.Editor"/> and the state buffers for the editor will be active.
/// </remarks>
public static InputUpdateType currentUpdate => InputUpdate.s_LastUpdateType;
public static InputUpdateType currentUpdateType => InputUpdate.s_LastUpdateType;
////FIXME: ATM this does not work for editor updates
/// <summary>
/// The number of times the current input state has been updated.
/// </summary>
public static uint updateCount => InputUpdate.s_UpdateStepCount;
public static double currentTime => InputRuntime.s_Instance.currentTime + InputRuntime.s_CurrentTimeOffsetToRealtimeSinceStartup;

Просмотреть файл

@ -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

Просмотреть файл

@ -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
{
/// <summary>
/// A union holding a primitive value.
/// </summary>
/// <remarks>
/// This structure is used for storing things such as default values for controls
/// (see <see cref="Layouts.InputControlLayout.ControlItem.defaultState"/>). It can
/// store one value of any primitive, non-reference C# type (bool, char, int, float, etc).
/// </remarks>
[StructLayout(LayoutKind.Explicit)]
public struct PrimitiveValue : IEquatable<PrimitiveValue>, IConvertible
{
@ -25,10 +32,15 @@ namespace UnityEngine.InputSystem.Utilities
[FieldOffset(4)] private float m_FloatValue;
[FieldOffset(4)] private double m_DoubleValue;
/// <summary>
/// Type of value stored in the struct. <see cref="TypeCode.Empty"/>
/// if the struct does not hold a value (i.e. has been default-initialized).
/// </summary>
public TypeCode type => m_Type;
/// <summary>
/// If true, the struct does not contain a primitive value.
/// If true, the struct does not contain a primitive value (i.e. has <see cref="type"/>
/// <see cref="TypeCode.Empty"/>).
/// </summary>
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;
}
}

Просмотреть файл

@ -126,7 +126,6 @@ namespace UnityEngine.InputSystem.Utilities
}
}
return type.GenericTypeArguments[argumentIndex];
}
}

Просмотреть файл

@ -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"
}