Skip to content

Commit 59db7b7

Browse files
committed
Merge branch 'develop' into stable
2 parents 4176ff7 + 160bde4 commit 59db7b7

28 files changed

+660
-115
lines changed

Assets/Samples/InGameHints/InGameHintsActions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//------------------------------------------------------------------------------
22
// <auto-generated>
33
// This code was auto-generated by com.unity.inputsystem:InputActionCodeGenerator
4-
// version 1.4.3
4+
// version 1.4.4
55
// from Assets/Samples/InGameHints/InGameHintsActions.inputactions
66
//
77
// Changes to this file may cause incorrect behavior and will be lost if

Assets/Samples/SimpleDemo/SimpleControls.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//------------------------------------------------------------------------------
22
// <auto-generated>
33
// This code was auto-generated by com.unity.inputsystem:InputActionCodeGenerator
4-
// version 1.4.3
4+
// version 1.4.4
55
// from Assets/Samples/SimpleDemo/SimpleControls.inputactions
66
//
77
// Changes to this file may cause incorrect behavior and will be lost if

Assets/Samples/Visualizers/GamepadVisualizer.unity

Lines changed: 162 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@ RenderSettings:
3838
m_ReflectionIntensity: 1
3939
m_CustomReflection: {fileID: 0}
4040
m_Sun: {fileID: 0}
41-
m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1}
41+
m_IndirectSpecularColor: {r: 0.37311953, g: 0.38074014, b: 0.3587274, a: 1}
4242
m_UseRadianceAmbientProbe: 0
4343
--- !u!157 &3
4444
LightmapSettings:
4545
m_ObjectHideFlags: 0
46-
serializedVersion: 11
46+
serializedVersion: 12
4747
m_GIWorkflowMode: 1
4848
m_GISettings:
4949
serializedVersion: 2
@@ -94,16 +94,17 @@ LightmapSettings:
9494
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
9595
m_PVRFilteringAtrousPositionSigmaIndirect: 2
9696
m_PVRFilteringAtrousPositionSigmaAO: 1
97-
m_ShowResolutionOverlay: 1
9897
m_ExportTrainingData: 0
98+
m_TrainingDataDestination: TrainingData
99+
m_LightProbeSampleCountMultiplier: 4
99100
m_LightingDataAsset: {fileID: 0}
100-
m_UseShadowmask: 1
101+
m_LightingSettings: {fileID: 1162315431}
101102
--- !u!196 &4
102103
NavMeshSettings:
103104
serializedVersion: 2
104105
m_ObjectHideFlags: 0
105106
m_BuildSettings:
106-
serializedVersion: 2
107+
serializedVersion: 3
107108
agentTypeID: 0
108109
agentRadius: 0.5
109110
agentHeight: 2
@@ -116,7 +117,9 @@ NavMeshSettings:
116117
cellSize: 0.16666667
117118
manualTileSize: 0
118119
tileSize: 256
119-
accuratePlacement: 0
120+
buildHeightMesh: 0
121+
maxJobWorkers: 0
122+
preserveTilesOutsideBounds: 0
120123
debug:
121124
m_Flags: 0
122125
m_NavMeshData: {fileID: 0}
@@ -160,9 +163,17 @@ Camera:
160163
m_projectionMatrixMode: 1
161164
m_GateFitMode: 2
162165
m_FOVAxisMode: 0
166+
m_Iso: 200
167+
m_ShutterSpeed: 0.005
168+
m_Aperture: 16
169+
m_FocusDistance: 10
170+
m_FocalLength: 50
171+
m_BladeCount: 5
172+
m_Curvature: {x: 2, y: 11}
173+
m_BarrelClipping: 0.25
174+
m_Anamorphism: 0
163175
m_SensorSize: {x: 36, y: 24}
164176
m_LensShift: {x: 0, y: 0}
165-
m_FocalLength: 50
166177
m_NormalizedViewPortRect:
167178
serializedVersion: 2
168179
x: 0
@@ -199,22 +210,154 @@ Transform:
199210
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
200211
m_LocalPosition: {x: 0, y: 1, z: -10}
201212
m_LocalScale: {x: 1, y: 1, z: 1}
213+
m_ConstrainProportionsScale: 0
202214
m_Children: []
203215
m_Father: {fileID: 0}
204216
m_RootOrder: 0
205217
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
218+
--- !u!4 &989925709 stripped
219+
Transform:
220+
m_CorrespondingSourceObject: {fileID: 5430831075476541851, guid: b8429651427a640919754290f3704312,
221+
type: 3}
222+
m_PrefabInstance: {fileID: 5430831075364511436}
223+
m_PrefabAsset: {fileID: 0}
224+
--- !u!850595691 &1162315431
225+
LightingSettings:
226+
m_ObjectHideFlags: 0
227+
m_CorrespondingSourceObject: {fileID: 0}
228+
m_PrefabInstance: {fileID: 0}
229+
m_PrefabAsset: {fileID: 0}
230+
m_Name: Settings.lighting
231+
serializedVersion: 6
232+
m_GIWorkflowMode: 1
233+
m_EnableBakedLightmaps: 1
234+
m_EnableRealtimeLightmaps: 1
235+
m_RealtimeEnvironmentLighting: 1
236+
m_BounceScale: 1
237+
m_AlbedoBoost: 1
238+
m_IndirectOutputScale: 1
239+
m_UsingShadowmask: 1
240+
m_BakeBackend: 1
241+
m_LightmapMaxSize: 1024
242+
m_BakeResolution: 40
243+
m_Padding: 2
244+
m_LightmapCompression: 3
245+
m_AO: 0
246+
m_AOMaxDistance: 1
247+
m_CompAOExponent: 1
248+
m_CompAOExponentDirect: 0
249+
m_ExtractAO: 0
250+
m_MixedBakeMode: 2
251+
m_LightmapsBakeMode: 1
252+
m_FilterMode: 1
253+
m_LightmapParameters: {fileID: 15204, guid: 0000000000000000f000000000000000, type: 0}
254+
m_ExportTrainingData: 0
255+
m_TrainingDataDestination: TrainingData
256+
m_RealtimeResolution: 2
257+
m_ForceWhiteAlbedo: 0
258+
m_ForceUpdates: 0
259+
m_FinalGather: 0
260+
m_FinalGatherRayCount: 256
261+
m_FinalGatherFiltering: 1
262+
m_PVRCulling: 1
263+
m_PVRSampling: 1
264+
m_PVRDirectSampleCount: 32
265+
m_PVRSampleCount: 512
266+
m_PVREnvironmentSampleCount: 256
267+
m_PVREnvironmentReferencePointCount: 2048
268+
m_LightProbeSampleCountMultiplier: 4
269+
m_PVRBounces: 2
270+
m_PVRMinBounces: 2
271+
m_PVREnvironmentImportanceSampling: 1
272+
m_PVRFilteringMode: 1
273+
m_PVRDenoiserTypeDirect: 1
274+
m_PVRDenoiserTypeIndirect: 1
275+
m_PVRDenoiserTypeAO: 1
276+
m_PVRFilterTypeDirect: 0
277+
m_PVRFilterTypeIndirect: 0
278+
m_PVRFilterTypeAO: 0
279+
m_PVRFilteringGaussRadiusDirect: 1
280+
m_PVRFilteringGaussRadiusIndirect: 5
281+
m_PVRFilteringGaussRadiusAO: 2
282+
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
283+
m_PVRFilteringAtrousPositionSigmaIndirect: 2
284+
m_PVRFilteringAtrousPositionSigmaAO: 1
285+
m_PVRTiledBaking: 0
286+
m_NumRaysToShootPerTexel: -1
287+
--- !u!1 &1615874397
288+
GameObject:
289+
m_ObjectHideFlags: 0
290+
m_CorrespondingSourceObject: {fileID: 0}
291+
m_PrefabInstance: {fileID: 0}
292+
m_PrefabAsset: {fileID: 0}
293+
serializedVersion: 6
294+
m_Component:
295+
- component: {fileID: 1615874398}
296+
- component: {fileID: 1615874399}
297+
m_Layer: 0
298+
m_Name: DeviceCurrent
299+
m_TagString: Untagged
300+
m_Icon: {fileID: 0}
301+
m_NavMeshLayer: 0
302+
m_StaticEditorFlags: 0
303+
m_IsActive: 1
304+
--- !u!4 &1615874398
305+
Transform:
306+
m_ObjectHideFlags: 0
307+
m_CorrespondingSourceObject: {fileID: 0}
308+
m_PrefabInstance: {fileID: 0}
309+
m_PrefabAsset: {fileID: 0}
310+
m_GameObject: {fileID: 1615874397}
311+
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
312+
m_LocalPosition: {x: -955.3655, y: -464.9797, z: 160.45508}
313+
m_LocalScale: {x: 1, y: 1, z: 1}
314+
m_ConstrainProportionsScale: 0
315+
m_Children: []
316+
m_Father: {fileID: 989925709}
317+
m_RootOrder: 0
318+
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
319+
--- !u!114 &1615874399
320+
MonoBehaviour:
321+
m_ObjectHideFlags: 0
322+
m_CorrespondingSourceObject: {fileID: 0}
323+
m_PrefabInstance: {fileID: 0}
324+
m_PrefabAsset: {fileID: 0}
325+
m_GameObject: {fileID: 1615874397}
326+
m_Enabled: 1
327+
m_EditorHideFlags: 0
328+
m_Script: {fileID: 11500000, guid: 50c7363fac4d24ae8a679e3e8f1fa838, type: 3}
329+
m_Name:
330+
m_EditorClassIdentifier:
331+
m_Label: Gamepad.current
332+
m_HistorySamples: 0
333+
m_TimeWindow: 3
334+
m_Rect:
335+
serializedVersion: 2
336+
x: 650
337+
y: 50
338+
width: 200
339+
height: 50
340+
m_Visualization: 8
341+
m_ControlPath: <Gamepad>/buttonEast
342+
m_ControlIndex: 0
206343
--- !u!1001 &5430831075364511436
207344
PrefabInstance:
208345
m_ObjectHideFlags: 0
209346
serializedVersion: 2
210347
m_Modification:
348+
serializedVersion: 3
211349
m_TransformParent: {fileID: 0}
212350
m_Modifications:
213351
- target: {fileID: 5430831075476541849, guid: b8429651427a640919754290f3704312,
214352
type: 3}
215353
propertyPath: m_Name
216354
value: GamepadVis
217355
objectReference: {fileID: 0}
356+
- target: {fileID: 5430831075476541851, guid: b8429651427a640919754290f3704312,
357+
type: 3}
358+
propertyPath: m_RootOrder
359+
value: 1
360+
objectReference: {fileID: 0}
218361
- target: {fileID: 5430831075476541851, guid: b8429651427a640919754290f3704312,
219362
type: 3}
220363
propertyPath: m_LocalPosition.x
@@ -230,6 +373,11 @@ PrefabInstance:
230373
propertyPath: m_LocalPosition.z
231374
value: -160.45508
232375
objectReference: {fileID: 0}
376+
- target: {fileID: 5430831075476541851, guid: b8429651427a640919754290f3704312,
377+
type: 3}
378+
propertyPath: m_LocalRotation.w
379+
value: 1
380+
objectReference: {fileID: 0}
233381
- target: {fileID: 5430831075476541851, guid: b8429651427a640919754290f3704312,
234382
type: 3}
235383
propertyPath: m_LocalRotation.x
@@ -245,16 +393,6 @@ PrefabInstance:
245393
propertyPath: m_LocalRotation.z
246394
value: 0
247395
objectReference: {fileID: 0}
248-
- target: {fileID: 5430831075476541851, guid: b8429651427a640919754290f3704312,
249-
type: 3}
250-
propertyPath: m_LocalRotation.w
251-
value: 1
252-
objectReference: {fileID: 0}
253-
- target: {fileID: 5430831075476541851, guid: b8429651427a640919754290f3704312,
254-
type: 3}
255-
propertyPath: m_RootOrder
256-
value: 1
257-
objectReference: {fileID: 0}
258396
- target: {fileID: 5430831075476541851, guid: b8429651427a640919754290f3704312,
259397
type: 3}
260398
propertyPath: m_LocalEulerAnglesHint.x
@@ -271,4 +409,11 @@ PrefabInstance:
271409
value: 0
272410
objectReference: {fileID: 0}
273411
m_RemovedComponents: []
412+
m_RemovedGameObjects: []
413+
m_AddedGameObjects:
414+
- targetCorrespondingSourceObject: {fileID: 5430831075476541851, guid: b8429651427a640919754290f3704312,
415+
type: 3}
416+
insertIndex: -1
417+
addedObject: {fileID: 1615874398}
418+
m_AddedComponents: []
274419
m_SourcePrefab: {fileID: 100100000, guid: b8429651427a640919754290f3704312, type: 3}

Assets/Samples/Visualizers/InputControlVisualizer.cs

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,12 @@ private void SetupVisualizer()
243243
break;
244244
}
245245

246+
case Mode.DeviceCurrent:
247+
{
248+
m_Visualizer = new VisualizationHelpers.CurrentDeviceVisualizer();
249+
break;
250+
}
251+
246252
default:
247253
throw new NotImplementedException();
248254
}
@@ -284,11 +290,11 @@ private static void OnEvent(InputEventPtr eventPtr, InputDevice device)
284290
if (component.m_Control?.device != device || component.m_Visualizer == null)
285291
continue;
286292

287-
component.OnEventImpl(eventPtr);
293+
component.OnEventImpl(eventPtr, device);
288294
}
289295
}
290296

291-
private unsafe void OnEventImpl(InputEventPtr eventPtr)
297+
private unsafe void OnEventImpl(InputEventPtr eventPtr, InputDevice device)
292298
{
293299
switch (m_Visualization)
294300
{
@@ -341,6 +347,12 @@ private unsafe void OnEventImpl(InputEventPtr eventPtr)
341347
new Vector2(0, Mathf.Max(value, visualizer.limitsY.y));
342348
break;
343349
}
350+
351+
case Mode.DeviceCurrent:
352+
{
353+
m_Visualizer.AddSample(device, eventPtr.time);
354+
break;
355+
}
344356
}
345357
}
346358

@@ -354,6 +366,7 @@ public enum Mode
354366
Events = 4,
355367
MaximumLag = 6,
356368
Bytes = 7,
369+
DeviceCurrent = 8,
357370
}
358371
}
359372
}

Assets/Samples/Visualizers/VisualizationHelpers.cs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,37 @@ private static unsafe float Divide(TValue left, TValue right)
138138
}
139139
}
140140

141+
// Visualizes .current device value
142+
public class CurrentDeviceVisualizer : Visualizer
143+
{
144+
private InputDevice m_CurrentDevice = null;
145+
146+
public override void OnDraw(Rect rect)
147+
{
148+
// For now, only draw the current value.
149+
DrawRectangle(rect, new Color(1, 1, 1, 0.1f));
150+
151+
var name = m_CurrentDevice != null ? m_CurrentDevice.name : "null";
152+
DrawText(name, new Vector2(rect.xMin + 4, (rect.yMin + rect.yMax) / 2.0f), ValueTextStyle);
153+
}
154+
155+
public override void AddSample(object value, double time)
156+
{
157+
var device = (InputDevice)value;
158+
if (device is Gamepad)
159+
m_CurrentDevice = Gamepad.current;
160+
else if (device is Mouse)
161+
m_CurrentDevice = Mouse.current;
162+
else if (device is Pen)
163+
m_CurrentDevice = Pen.current;
164+
else if (device is Pointer) // should be last, because it's a base class for Mouse and Pen
165+
m_CurrentDevice = Pointer.current;
166+
else
167+
throw new ArgumentException(
168+
$"Expected device type that implements .current, but got '{device.name}' (deviceId: {device.deviceId}) instead ");
169+
}
170+
}
171+
141172
////TODO: allow asymmetric center (i.e. center not being a midpoint of rectangle)
142173
////TODO: enforce proper proportion between X and Y; it's confusing that X and Y can have different units yet have the same length
143174
public class Vector2Visualizer : ValueVisualizer<Vector2>

0 commit comments

Comments
 (0)