Skip to content

Commit 2c3bae9

Browse files
committed
Formatting and typo updates
1 parent 3a053ec commit 2c3bae9

1 file changed

Lines changed: 10 additions & 8 deletions

File tree

org.mixedrealitytoolkit.uxcore/SeeItSayIt/SeeItSayItLabelEnabler.cs

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public class SeeItSayItLabelEnabler : MonoBehaviour
3232
/// The <see cref="PressableButton"/> present on the same GameObject.
3333
/// </summary>
3434
private PressableButton pressableButton;
35-
35+
3636
/// <summary>
3737
/// The <see cref="TMP_Text"/> used to display the label present in child.
3838
/// </summary>
@@ -57,11 +57,11 @@ public GameObject SeeItSayItLabel
5757
private LocalizedString localizedPattern;
5858
#else
5959
[SerializeField]
60-
[Tooltip("The patern for the see-it say-it label using string.Format()")]
60+
[Tooltip("The pattern for the see-it say-it label using string.Format()")]
6161
private string pattern = "Say '{0}'";
6262

6363
/// <summary>
64-
/// The patern for the see-it say-it label using string.Format()
64+
/// The pattern for the see-it say-it label using string.Format()
6565
/// </summary>
6666
public string Pattern
6767
{
@@ -90,8 +90,8 @@ public Transform PositionControl
9090
set => positionControl = value;
9191
}
9292

93-
private float canvasOffset = -10f;
94-
private float nonCanvasOffset = -.004f;
93+
private const float CanvasOffset = -10f;
94+
private const float NonCanvasOffset = -0.004f;
9595

9696
protected virtual void Awake()
9797
{
@@ -144,12 +144,12 @@ protected virtual void Start()
144144

145145
if (labelTransform != null && canvasTransform != null)
146146
{
147-
labelTransform.anchoredPosition3D = new Vector3(canvasTransform.rect.width / 2f, canvasTransform.rect.height / 2f + (controlRectTransform.rect.height / 2f * -1) + canvasOffset, canvasOffset);
147+
labelTransform.anchoredPosition3D = new Vector3(canvasTransform.rect.width / 2f, canvasTransform.rect.height / 2f + (controlRectTransform.rect.height / 2f * -1) + CanvasOffset, CanvasOffset);
148148
}
149149
}
150150
else
151151
{
152-
SeeItSayItLabel.transform.localPosition = new Vector3(PositionControl.localPosition.x, (PositionControl.lossyScale.y / 2f * -1) + nonCanvasOffset, PositionControl.localPosition.z + nonCanvasOffset);
152+
SeeItSayItLabel.transform.localPosition = new Vector3(PositionControl.localPosition.x, (PositionControl.lossyScale.y / 2f * -1) + NonCanvasOffset, PositionControl.localPosition.z + NonCanvasOffset);
153153
}
154154
}
155155

@@ -177,7 +177,7 @@ protected virtual void OnDestroy()
177177
#endif
178178
}
179179
#endif
180-
}
180+
}
181181

182182
protected virtual void UpdateLabel(string keyword)
183183
{
@@ -200,9 +200,11 @@ protected virtual void UpdateLabel(string keyword)
200200
#endif
201201
}
202202

203+
#if UNITY_LOCALIZATION_PRESENT
203204
protected virtual void OnLocalizedPatternChanged(string value)
204205
{
205206
UpdateLabel(pressableButton.SpeechRecognitionKeyword);
206207
}
208+
#endif
207209
}
208210
}

0 commit comments

Comments
 (0)