Skip to content

Commit 0c8fb0d

Browse files
committed
Minor cleanup of ET related nav scripts
- Removed some deprecated parameters in the scroll scripts that were still shown in the Editor. - Updated hand zoom parameter that was specific to zoom, but was shown for scroll.
1 parent beef88e commit 0c8fb0d

File tree

7 files changed

+20
-24
lines changed

7 files changed

+20
-24
lines changed

Assets/MixedRealityToolkit.Examples/Demos/EyeTracking/Demo_ScrollPanZoom/Scripts/BaseClasses/PanZoomBase.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public abstract class PanZoomBase : MonoBehaviour,
121121
private Vector3 navPos = Vector3.zero;
122122
private bool isFocused = false;
123123
internal bool isZooming = false;
124-
public bool handZoomEnabledOnStartup = false;
124+
internal bool ZoomGestureEnabledOnStartup = false;
125125
private bool handZoomEnabled = false;
126126

127127
protected Vector3 originalRatio;
@@ -145,7 +145,7 @@ protected virtual void Start()
145145
{
146146
// Init children
147147
Initialize();
148-
handZoomEnabled = handZoomEnabledOnStartup;
148+
handZoomEnabled = ZoomGestureEnabledOnStartup;
149149
Initialize();
150150

151151
// Init eye tracking target

Assets/MixedRealityToolkit.Examples/Demos/EyeTracking/Demo_ScrollPanZoom/Scripts/BaseClasses/PanZoomBase_Texture.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ public string TextureShaderProperty
2626
}
2727
}
2828

29+
[Tooltip("Underlying aspect ratio of the loaded texture to correctly determine scaling.")]
2930
[SerializeField]
3031
private float DefaultAspectRatio = 1.0f;
3132

Assets/MixedRealityToolkit.Examples/Demos/EyeTracking/Demo_ScrollPanZoom/Scripts/PanZoom_RectTransf.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ public class PanZoom_RectTransf : PanZoomBase_RectTransf
7070
[SerializeField]
7171
private MixedRealityInputAction Zoom_Gesture = MixedRealityInputAction.None;
7272

73+
[Tooltip("Enable or disable hand gestures for zooming on startup.")]
74+
[SerializeField]
75+
private bool Zoom_GestureEnabledOnStartup = false;
76+
7377
// The base PanAndZoom class can also be used with UV textures for which the dimensions are different to a RectTransform.
7478
// To allow to keep the speed values that users can assign consistent, let's internally convert the values.
7579
private float convertSpeedToUVSpace = -200.0f;
@@ -96,6 +100,7 @@ protected override void Start()
96100
ZoomMinScale = Zoom_MinScale;
97101
ZoomMaxScale = Zoom_MaxScale;
98102
ZoomGesture = Zoom_Gesture;
103+
ZoomGestureEnabledOnStartup = Zoom_GestureEnabledOnStartup;
99104
timeInSecondsToZoom = Zoom_TimeInSecToZoom;
100105

101106
base.Start();

Assets/MixedRealityToolkit.Examples/Demos/EyeTracking/Demo_ScrollPanZoom/Scripts/PanZoom_Texture.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Copyright (c) Microsoft Corporation. All rights reserved.
22
// Licensed under the MIT License. See LICENSE in the project root for license information.
33

4-
using Microsoft.MixedReality.Toolkit.Examples.Demos.EyeTracking;
54
using Microsoft.MixedReality.Toolkit.Input;
65
using UnityEngine;
76

@@ -10,7 +9,6 @@ namespace Microsoft.MixedReality.Toolkit.Examples.Demos.EyeTracking
109
/// <summary>
1110
/// This script allows to scroll a texture both horizontally and vertically.
1211
/// </summary>
13-
[RequireComponent(typeof(EyeTrackingTarget))]
1412
public class PanZoom_Texture : PanZoomBase_Texture
1513
{
1614
[Tooltip("Referenced renderer of the texture to be navigated.")]
@@ -42,6 +40,10 @@ public class PanZoom_Texture : PanZoomBase_Texture
4240
[SerializeField]
4341
private MixedRealityInputAction Zoom_Gesture = MixedRealityInputAction.None;
4442

43+
[Tooltip("Enable or disable hand gestures for zooming on startup.")]
44+
[SerializeField]
45+
private bool Zoom_GestureEnabledOnStartup = false;
46+
4547
// Pan
4648
[Tooltip("Ability to scroll using your eye gaze without any additional input (e.g., air tap or button presses).")]
4749
[SerializeField]
@@ -78,6 +80,7 @@ protected override void Start()
7880
ZoomMinScale = Zoom_MinScale;
7981
ZoomMaxScale = Zoom_MaxScale;
8082
ZoomGesture = Zoom_Gesture;
83+
ZoomGestureEnabledOnStartup = Zoom_GestureEnabledOnStartup;
8184
timeInSecondsToZoom = Zoom_TimeInSecToZoom;
8285

8386
AutoGazePanIsActive = Pan_AutoScrollIsActive;

Assets/MixedRealityToolkit.Examples/Demos/EyeTracking/Demo_ScrollPanZoom/Scripts/Scroll_RectTransf.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
// Licensed under the MIT License. See LICENSE in the project root for license information.
33

44
using UnityEngine;
5-
using UnityEngine.UI;
65

76
namespace Microsoft.MixedReality.Toolkit.Examples.Demos.EyeTracking
87
{
@@ -50,13 +49,8 @@ public class Scroll_RectTransf : PanZoomBase_RectTransf
5049
// To allow to keep the speed values that users can assign consistent, let's internally convert the values.
5150
private float convertSpeedToUVSpace = -200.0f;
5251

52+
[Tooltip("Custom anchor start position.")]
5353
[SerializeField]
54-
private ContentSizeFitter contentSizeFitter;
55-
56-
[SerializeField]
57-
private AspectRatioFitter aspectRatioFitter;
58-
59-
private Vector2 lastUpdatedScrollExtent = new Vector2(-1, -1);
6054
public Vector2 CustomStartPos;
6155

6256
protected override void Start()

Assets/MixedRealityToolkit.Examples/Demos/EyeTracking/Scenes/mrtk_eyes_03_Navigation.unity

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,6 @@ MonoBehaviour:
347347
m_Name:
348348
m_EditorClassIdentifier:
349349
limitPanning: 1
350-
handZoomEnabledOnStartup: 0
351350
RectTransfToNavigate: {fileID: 127185898}
352351
RefToViewPort: {fileID: 1554205715}
353352
AutoGazeScrollIsActive: 1
@@ -365,6 +364,7 @@ MonoBehaviour:
365364
id: 9
366365
description: Manipulate Action
367366
axisConstraint: 0
367+
Zoom_GestureEnabledOnStartup: 0
368368
--- !u!114 &6659677
369369
MonoBehaviour:
370370
m_ObjectHideFlags: 0
@@ -2041,7 +2041,6 @@ MonoBehaviour:
20412041
m_Name:
20422042
m_EditorClassIdentifier:
20432043
limitPanning: 1
2044-
handZoomEnabledOnStartup: 0
20452044
DefaultAspectRatio: 1
20462045
TextureRendererToBeScrolled: {fileID: 151708624}
20472046
AutoGazeScrollIsActive: 1
@@ -5744,7 +5743,6 @@ MonoBehaviour:
57445743
m_Name:
57455744
m_EditorClassIdentifier:
57465745
limitPanning: 0
5747-
handZoomEnabledOnStartup: 1
57485746
DefaultAspectRatio: 0.5
57495747
RendererOfTextureToBeNavigated: {fileID: 1198226481}
57505748
Zoom_Acceleration: 10
@@ -5756,12 +5754,13 @@ MonoBehaviour:
57565754
id: 9
57575755
description: Manipulate Action
57585756
axisConstraint: 0
5757+
Zoom_GestureEnabledOnStartup: 1
57595758
Pan_AutoScrollIsActive: 1
57605759
Pan_Speed_x: 0.3
57615760
Pan_Speed_y: 0.3
57625761
Pan_MinDistFromCenter: {x: 0.2, y: 0.2}
57635762
UseSkimProofing: 1
5764-
SkimProofUpdateSpeed: 8.5
5763+
SkimProofUpdateSpeed: 5
57655764
--- !u!114 &1198226478
57665765
MonoBehaviour:
57675766
m_ObjectHideFlags: 0
@@ -6855,17 +6854,14 @@ MonoBehaviour:
68556854
m_Name:
68566855
m_EditorClassIdentifier:
68576856
limitPanning: 1
6858-
handZoomEnabledOnStartup: 0
68596857
RectTransfToNavigate: {fileID: 1852894734}
68606858
RefToViewPort: {fileID: 1295463316}
68616859
AutoGazeScrollIsActive: 1
68626860
ScrollSpeed_x: 0
68636861
ScrollSpeed_y: 0.3
68646862
MinDistFromCenterForAutoScroll: {x: 0.2, y: 0.2}
68656863
UseSkimProofing: 1
6866-
SkimProofUpdateSpeed: 8
6867-
contentSizeFitter: {fileID: 1852894737}
6868-
aspectRatioFitter: {fileID: 0}
6864+
SkimProofUpdateSpeed: 5
68696865
CustomStartPos: {x: 0, y: 0}
68706866
--- !u!114 &1380263302
68716867
MonoBehaviour:
@@ -9993,7 +9989,6 @@ MonoBehaviour:
99939989
m_Name:
99949990
m_EditorClassIdentifier:
99959991
limitPanning: 1
9996-
handZoomEnabledOnStartup: 0
99979992
RectTransfToNavigate: {fileID: 1465011397}
99989993
RefToViewPort: {fileID: 240345431}
99999994
AutoGazeScrollIsActive: 1
@@ -10002,8 +9997,6 @@ MonoBehaviour:
100029997
MinDistFromCenterForAutoScroll: {x: 0.2, y: 0.2}
100039998
UseSkimProofing: 1
100049999
SkimProofUpdateSpeed: 5
10005-
contentSizeFitter: {fileID: 0}
10006-
aspectRatioFitter: {fileID: 0}
1000710000
CustomStartPos: {x: 0, y: 0}
1000810001
--- !u!114 &2086128682
1000910002
MonoBehaviour:
@@ -10076,7 +10069,6 @@ MonoBehaviour:
1007610069
m_Name:
1007710070
m_EditorClassIdentifier:
1007810071
limitPanning: 1
10079-
handZoomEnabledOnStartup: 0
1008010072
RectTransfToNavigate: {fileID: 1465011397}
1008110073
RefToViewPort: {fileID: 0}
1008210074
AutoGazeScrollIsActive: 1
@@ -10094,3 +10086,4 @@ MonoBehaviour:
1009410086
id: 9
1009510087
description: Manipulate Action
1009610088
axisConstraint: 0
10089+
Zoom_GestureEnabledOnStartup: 0

ProjectSettings/ProjectVersion.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
m_EditorVersion: 2018.3.9f1
1+
m_EditorVersion: 2018.3.8f1

0 commit comments

Comments
 (0)