Skip to content

Commit a12ccc3

Browse files
authored
Merge pull request #9478 from keveleigh/2.6.1-cherrypicks
2.6.1 cherrypicks
2 parents f178c14 + d796858 commit a12ccc3

File tree

4 files changed

+54
-14
lines changed

4 files changed

+54
-14
lines changed

Assets/MRTK/Core/Utilities/StandardShader/ClippingPrimitive.cs

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -84,16 +84,19 @@ public bool UseOnPreRender
8484
cameraMethods = CameraCache.Main.gameObject.EnsureComponent<CameraEventRouter>();
8585
}
8686

87-
if (value)
87+
if (useOnPreRender != value)
8888
{
89-
cameraMethods.OnCameraPreRender += OnCameraPreRender;
90-
}
91-
else
92-
{
93-
cameraMethods.OnCameraPreRender -= OnCameraPreRender;
94-
}
89+
if (value)
90+
{
91+
cameraMethods.OnCameraPreRender += OnCameraPreRender;
92+
}
93+
else if (!value)
94+
{
95+
cameraMethods.OnCameraPreRender -= OnCameraPreRender;
96+
}
9597

96-
useOnPreRender = value;
98+
useOnPreRender = value;
99+
}
97100
}
98101
}
99102

@@ -240,7 +243,7 @@ protected void OnDisable()
240243

241244
if (cameraMethods != null)
242245
{
243-
cameraMethods.OnCameraPreRender -= OnCameraPreRender;
246+
UseOnPreRender = false;
244247
}
245248
}
246249

Assets/MRTK/Examples/Demos/UX/Dialog/Scripts/DialogExampleController.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,15 +56,15 @@ public GameObject DialogPrefabSmall
5656
/// </summary>
5757
public void OpenConfirmationDialogLarge()
5858
{
59-
Dialog.Open(DialogPrefabLarge, DialogButtonType.OK, "Confirmation Dialog, Large, Far", "This is an example of a large dialog with only one button, placed at near interaction range", false);
59+
Dialog.Open(DialogPrefabLarge, DialogButtonType.OK, "Confirmation Dialog, Large, Far", "This is an example of a large dialog with only one button, placed at far interaction range", false);
6060
}
6161

6262
/// <summary>
6363
/// Opens choice dialog example
6464
/// </summary>
6565
public void OpenChoiceDialogLarge()
6666
{
67-
Dialog myDialog = Dialog.Open(DialogPrefabLarge, DialogButtonType.Yes | DialogButtonType.No, "Choice Dialog, Large, Near", "This is an example of a large dialog with a choice message for the user, placed at far interaction range", true);
67+
Dialog myDialog = Dialog.Open(DialogPrefabLarge, DialogButtonType.Yes | DialogButtonType.No, "Choice Dialog, Large, Near", "This is an example of a large dialog with a choice message for the user, placed at near interaction range", true);
6868
if (myDialog != null)
6969
{
7070
myDialog.OnClosed += OnClosedDialogEvent;
@@ -96,15 +96,15 @@ public void OpenChoiceDialogMedium()
9696
/// </summary>
9797
public void OpenConfirmationDialogSmall()
9898
{
99-
Dialog.Open(DialogPrefabSmall, DialogButtonType.OK, "Confirmation Dialog, Small, Far", "This is an example of a small dialog with only one button, placed at near interaction range", false);
99+
Dialog.Open(DialogPrefabSmall, DialogButtonType.OK, "Confirmation Dialog, Small, Far", "This is an example of a small dialog with only one button, placed at far interaction range", false);
100100
}
101101

102102
/// <summary>
103103
/// Opens choice dialog example
104104
/// </summary>
105105
public void OpenChoiceDialogSmall()
106106
{
107-
Dialog myDialog = Dialog.Open(DialogPrefabSmall, DialogButtonType.Yes | DialogButtonType.No, "Choice Dialog, Small, Near", "This is an example of a small dialog with a choice message for the user, placed at far interaction range", true);
107+
Dialog myDialog = Dialog.Open(DialogPrefabSmall, DialogButtonType.Yes | DialogButtonType.No, "Choice Dialog, Small, Near", "This is an example of a small dialog with a choice message for the user, placed at near interaction range", true);
108108
if (myDialog != null)
109109
{
110110
myDialog.OnClosed += OnClosedDialogEvent;

Assets/MRTK/Providers/OpenXR/Scripts/OpenXRDeviceManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ private bool IsActiveLoader
4141
#if UNITY_OPENXR
4242
if (!isActiveLoader.HasValue)
4343
{
44-
isActiveLoader = IsLoaderActive<OpenXRLoader>();
44+
isActiveLoader = IsLoaderActive<OpenXRLoaderBase>();
4545
}
4646
#endif // UNITY_OPENXR
4747

Assets/MRTK/Tests/PlayModeTests/ScrollViewTests.cs

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1478,6 +1478,43 @@ public IEnumerator ScrollAmountHasCorrectDamp()
14781478
Assert.AreEqual((handTouchDelta - scrollView.HandDeltaScrollThreshold) / newScale, scrollView.ScrollContainerPosition.y, 0.005, "Scroll drag amount was not 1:1");
14791479
}
14801480

1481+
/// <summary>
1482+
/// Tests that no errors are raised after the scrolling object collection is removed from the scene
1483+
/// </summary>
1484+
[UnityTest]
1485+
public IEnumerator ScrollViewCleanup()
1486+
{
1487+
// Setting up a vertical 1x2 scroll view with three pressable buttons items
1488+
var contentItems = InstantiatePrefabItems(AssetDatabase.GUIDToAssetPath(PressableHololens2PrefabGuid), 3);
1489+
1490+
GridObjectCollection objectCollection = InstantiateObjectCollection(contentItems,
1491+
LayoutOrder.ColumnThenRow,
1492+
LayoutAnchor.UpperLeft,
1493+
1,
1494+
Vector3.forward,
1495+
Quaternion.identity,
1496+
0.032f,
1497+
0.032f);
1498+
1499+
ScrollingObjectCollection scrollView = InstantiateScrollView(1,
1500+
2,
1501+
objectCollection.CellWidth,
1502+
objectCollection.CellHeight,
1503+
0.016f,
1504+
Vector3.forward,
1505+
Quaternion.identity);
1506+
scrollView.AddContent(objectCollection.gameObject);
1507+
1508+
PressableButton button1Component = contentItems[0].GetComponentInChildren<PressableButton>();
1509+
1510+
Assert.IsNotNull(button1Component);
1511+
yield return PlayModeTestUtilities.WaitForInputSystemUpdate();
1512+
1513+
Object.Destroy(scrollView.gameObject);
1514+
1515+
yield return PlayModeTestUtilities.WaitForInputSystemUpdate();
1516+
}
1517+
14811518
#endregion Tests
14821519

14831520
#region Utilities

0 commit comments

Comments
 (0)