From 9116493a4a57aba984480923fd960fed61c5158c Mon Sep 17 00:00:00 2001 From: Risto Rangel Kuoppa Date: Wed, 14 Feb 2024 16:42:32 -0800 Subject: [PATCH 1/3] Big643-Fix adding missing SeeItSayItLabel, reference corresponding GameObject, and regression-prevention UnityTests --- .../CanvasExampleSimpleActionButton.unity | 48 ++++-- .../Tests/Runtime/PressableButtonTests.cs | 67 ++++++++ .../Experimental/SimpleEmptyButton.prefab | 151 +++++++++++++++++- .../package.json | 2 +- 4 files changed, 250 insertions(+), 18 deletions(-) diff --git a/UnityProjects/MRTKDevTemplate/Assets/Scenes/Experimental/CanvasExampleSimpleActionButton.unity b/UnityProjects/MRTKDevTemplate/Assets/Scenes/Experimental/CanvasExampleSimpleActionButton.unity index 6a41d6e88..9afb3c379 100644 --- a/UnityProjects/MRTKDevTemplate/Assets/Scenes/Experimental/CanvasExampleSimpleActionButton.unity +++ b/UnityProjects/MRTKDevTemplate/Assets/Scenes/Experimental/CanvasExampleSimpleActionButton.unity @@ -1145,6 +1145,10 @@ PrefabInstance: propertyPath: m_Size.x value: 64 objectReference: {fileID: 0} + - target: {fileID: 6429967702670035260, guid: a2b07dcaa4b2f8e4fa68b319f1477f4c, type: 3} + propertyPath: m_Size.y + value: 32 + objectReference: {fileID: 0} - target: {fileID: 8317193072831350119, guid: a2b07dcaa4b2f8e4fa68b319f1477f4c, type: 3} propertyPath: m_Name value: SimpleActionButton @@ -1931,6 +1935,10 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} + - target: {fileID: 6429967702670035260, guid: a2b07dcaa4b2f8e4fa68b319f1477f4c, type: 3} + propertyPath: m_Size.y + value: 32 + objectReference: {fileID: 0} - target: {fileID: 8317193072831350119, guid: a2b07dcaa4b2f8e4fa68b319f1477f4c, type: 3} propertyPath: m_Name value: SimpleActionButton @@ -2049,6 +2057,10 @@ PrefabInstance: propertyPath: m_Size.x value: 64 objectReference: {fileID: 0} + - target: {fileID: 6429967702670035260, guid: a2b07dcaa4b2f8e4fa68b319f1477f4c, type: 3} + propertyPath: m_Size.y + value: 32 + objectReference: {fileID: 0} - target: {fileID: 8317193072831350119, guid: a2b07dcaa4b2f8e4fa68b319f1477f4c, type: 3} propertyPath: m_Name value: SimpleActionButton @@ -2949,6 +2961,10 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} + - target: {fileID: 6429967702670035260, guid: a2b07dcaa4b2f8e4fa68b319f1477f4c, type: 3} + propertyPath: m_Size.y + value: 32 + objectReference: {fileID: 0} - target: {fileID: 8317193072831350119, guid: a2b07dcaa4b2f8e4fa68b319f1477f4c, type: 3} propertyPath: m_Name value: SimpleActionButton @@ -3658,19 +3674,19 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 209245566481228407, guid: cb2e4384d009baa4f804941a10b6781a, type: 3} propertyPath: m_AnchorMax.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 209245566481228407, guid: cb2e4384d009baa4f804941a10b6781a, type: 3} propertyPath: m_AnchorMin.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 209245566481228407, guid: cb2e4384d009baa4f804941a10b6781a, type: 3} propertyPath: m_AnchoredPosition.x - value: 0 + value: 52 objectReference: {fileID: 0} - target: {fileID: 209245566481228407, guid: cb2e4384d009baa4f804941a10b6781a, type: 3} propertyPath: m_AnchoredPosition.y - value: 0 + value: -16 objectReference: {fileID: 0} - target: {fileID: 245743749482424678, guid: cb2e4384d009baa4f804941a10b6781a, type: 3} propertyPath: m_Size.x @@ -4514,19 +4530,19 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 4691149524986514612, guid: cb2e4384d009baa4f804941a10b6781a, type: 3} propertyPath: m_AnchorMax.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 4691149524986514612, guid: cb2e4384d009baa4f804941a10b6781a, type: 3} propertyPath: m_AnchorMin.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 4691149524986514612, guid: cb2e4384d009baa4f804941a10b6781a, type: 3} propertyPath: m_AnchoredPosition.x - value: 0 + value: 84 objectReference: {fileID: 0} - target: {fileID: 4691149524986514612, guid: cb2e4384d009baa4f804941a10b6781a, type: 3} propertyPath: m_AnchoredPosition.y - value: 0 + value: -16 objectReference: {fileID: 0} - target: {fileID: 4804666115626773169, guid: cb2e4384d009baa4f804941a10b6781a, type: 3} propertyPath: m_AnchorMax.y @@ -4674,19 +4690,19 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 5288391855603297685, guid: cb2e4384d009baa4f804941a10b6781a, type: 3} propertyPath: m_AnchorMax.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 5288391855603297685, guid: cb2e4384d009baa4f804941a10b6781a, type: 3} propertyPath: m_AnchorMin.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 5288391855603297685, guid: cb2e4384d009baa4f804941a10b6781a, type: 3} propertyPath: m_AnchoredPosition.x - value: 0 + value: 116 objectReference: {fileID: 0} - target: {fileID: 5288391855603297685, guid: cb2e4384d009baa4f804941a10b6781a, type: 3} propertyPath: m_AnchoredPosition.y - value: 0 + value: -16 objectReference: {fileID: 0} - target: {fileID: 5349970067465533917, guid: cb2e4384d009baa4f804941a10b6781a, type: 3} propertyPath: m_AnchorMax.y @@ -4754,19 +4770,19 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 5781719418039964675, guid: cb2e4384d009baa4f804941a10b6781a, type: 3} propertyPath: m_AnchorMax.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 5781719418039964675, guid: cb2e4384d009baa4f804941a10b6781a, type: 3} propertyPath: m_AnchorMin.y - value: 0 + value: 1 objectReference: {fileID: 0} - target: {fileID: 5781719418039964675, guid: cb2e4384d009baa4f804941a10b6781a, type: 3} propertyPath: m_AnchoredPosition.x - value: 0 + value: 20 objectReference: {fileID: 0} - target: {fileID: 5781719418039964675, guid: cb2e4384d009baa4f804941a10b6781a, type: 3} propertyPath: m_AnchoredPosition.y - value: 0 + value: -16 objectReference: {fileID: 0} - target: {fileID: 5788948128220438741, guid: cb2e4384d009baa4f804941a10b6781a, type: 3} propertyPath: m_fontSize diff --git a/org.mixedrealitytoolkit.uxcomponents.noncanvas/Tests/Runtime/PressableButtonTests.cs b/org.mixedrealitytoolkit.uxcomponents.noncanvas/Tests/Runtime/PressableButtonTests.cs index 3d0c8d4bc..52ea35b3b 100644 --- a/org.mixedrealitytoolkit.uxcomponents.noncanvas/Tests/Runtime/PressableButtonTests.cs +++ b/org.mixedrealitytoolkit.uxcomponents.noncanvas/Tests/Runtime/PressableButtonTests.cs @@ -908,6 +908,73 @@ public IEnumerator TestPressableButtonIsProximityHoveredPropertyIsOfTypeTimedFla yield return null; } + + /// + /// In MRTK3 Issue 643 Experimental SimpleEmptyButton didn't have a SeeItSayItLabel component and it should have one + /// and the associated GameObject shouldn't be null. + /// This test is to confirm that this has not regressed. + /// https://github.com/MixedRealityToolkit/MixedRealityToolkit-Unity/issues/643 + /// + [UnityTest] + public IEnumerator TestSimpleEmptyButtonHasSeeItSayItLabelComponentAndReferencedGameObjectIsNotNull() + { + // instantiate scene and button + string SimpleEmptyButtonPath = AssetDatabase.GUIDToAssetPath("7ed78718e86d3cc469e6abbecb4a8508"); + GameObject testSimpleEmptyButton = InstantiateDefaultPressableButton(SimpleEmptyButtonPath); + yield return null; + + SeeItSayItLabelEnabler[] seeItSayitLabelEnablerComponents = testSimpleEmptyButton.GetComponents(); + Assert.AreEqual(1, seeItSayitLabelEnablerComponents.Length); //Check it has the component + + GameObject seeItSayItLabelGameObject = null; + foreach (Transform child in testSimpleEmptyButton.transform) + { + if (child.name.Equals("SeeItSayItLabel-Canvas")) + { + seeItSayItLabelGameObject = child.gameObject; + } + } + Assert.IsNotNull(seeItSayItLabelGameObject); //Check the referenced GameObject is not null + + Object.Destroy(testSimpleEmptyButton); + // Wait for a frame to give Unity a change to actually destroy the object + + yield return null; + } + + /// + /// In MRTK3 Issue 643 Experimental SimpleActionButton didn't have a SeeItSayItLabel component and it should have one + /// and the associated GameObject shouldn't be null. + /// This test is to confirm that this has not regressed. + /// https://github.com/MixedRealityToolkit/MixedRealityToolkit-Unity/issues/643 + /// + [UnityTest] + public IEnumerator TestSimpleActionButtonHasSeeItSayItLabelComponentAndReferencedGameObjectIsNotNull() + { + // instantiate scene and button + string SimpleActionButtonPath = AssetDatabase.GUIDToAssetPath("a2b07dcaa4b2f8e4fa68b319f1477f4c"); + GameObject testSimpleActionButton = InstantiateDefaultPressableButton(SimpleActionButtonPath); + yield return null; + + SeeItSayItLabelEnabler[] seeItSayitLabelEnablerComponents = testSimpleActionButton.GetComponents(); + Assert.AreEqual(1, seeItSayitLabelEnablerComponents.Length); //Check it has the component + + GameObject seeItSayItLabelGameObject = null; + foreach (Transform child in testSimpleActionButton.transform) + { + if (child.name.Equals("SeeItSayItLabel-Canvas")) + { + seeItSayItLabelGameObject = child.gameObject; + } + } + Assert.IsNotNull(seeItSayItLabelGameObject); //Check the referenced GameObject is not null + + Object.Destroy(testSimpleActionButton); + // Wait for a frame to give Unity a change to actually destroy the object + + yield return null; + } + #endregion Tests #region Private methods diff --git a/org.mixedrealitytoolkit.uxcomponents/Button/Prefabs/Experimental/SimpleEmptyButton.prefab b/org.mixedrealitytoolkit.uxcomponents/Button/Prefabs/Experimental/SimpleEmptyButton.prefab index aa69ffe66..ca56e86dc 100644 --- a/org.mixedrealitytoolkit.uxcomponents/Button/Prefabs/Experimental/SimpleEmptyButton.prefab +++ b/org.mixedrealitytoolkit.uxcomponents/Button/Prefabs/Experimental/SimpleEmptyButton.prefab @@ -80,6 +80,7 @@ RectTransform: - {fileID: 3740913922251384226} - {fileID: 4622376002038962823} - {fileID: 1479722257174828772} + - {fileID: 8330882562871208312} m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -322,6 +323,14 @@ MonoBehaviour: rollOffXYDepth: 3 rejectZRollOff: 0 extendSpeed: 0.5 + k__BackingField: + active: 0 + onEntered: + m_PersistentCalls: + m_Calls: [] + onExited: + m_PersistentCalls: + m_Calls: [] --- !u!114 &1621070622446983610 MonoBehaviour: m_ObjectHideFlags: 0 @@ -394,6 +403,7 @@ MonoBehaviour: attachedRectTransform: {fileID: 4636237264255655829} padding: {x: 0, y: 0} forceUpdateEveryFrame: 0 + canToggleCollider: 1 --- !u!95 &1144530035273243757 Animator: serializedVersion: 5 @@ -656,7 +666,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 887413f36d993624185e96e7a5c71622, type: 3} m_Name: m_EditorClassIdentifier: - seeItSayItLabel: {fileID: 3464703255337796189, guid: 61e7043680446ea478dc1842aea6d5d1, type: 3} + seeItSayItLabel: {fileID: 2424565416812693168} positionControl: {fileID: 0} --- !u!1 &4329706101934279475 GameObject: @@ -1170,3 +1180,142 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: duration: 1.2 +--- !u!1001 &210710825179524191 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 4636237264255655829} + m_Modifications: + - target: {fileID: 2542652557800958703, guid: d9e84b5a8037fd946aa503a059fee93f, type: 3} + propertyPath: m_Name + value: SeeItSayItLabel-Canvas + objectReference: {fileID: 0} + - target: {fileID: 2542652557800958703, guid: d9e84b5a8037fd946aa503a059fee93f, type: 3} + propertyPath: m_IsActive + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4142207705701966788, guid: d9e84b5a8037fd946aa503a059fee93f, type: 3} + propertyPath: interactable + value: + objectReference: {fileID: 5561622762392946040} + - target: {fileID: 6129546144166981335, guid: d9e84b5a8037fd946aa503a059fee93f, type: 3} + propertyPath: m_SizeDelta.x + value: 36 + objectReference: {fileID: 0} + - target: {fileID: 6129546144166981335, guid: d9e84b5a8037fd946aa503a059fee93f, type: 3} + propertyPath: m_SizeDelta.y + value: 10 + objectReference: {fileID: 0} + - target: {fileID: 8174497233233282343, guid: d9e84b5a8037fd946aa503a059fee93f, type: 3} + propertyPath: m_Pivot.x + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 8174497233233282343, guid: d9e84b5a8037fd946aa503a059fee93f, type: 3} + propertyPath: m_Pivot.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 8174497233233282343, guid: d9e84b5a8037fd946aa503a059fee93f, type: 3} + propertyPath: m_RootOrder + value: 6 + objectReference: {fileID: 0} + - target: {fileID: 8174497233233282343, guid: d9e84b5a8037fd946aa503a059fee93f, type: 3} + propertyPath: m_AnchorMax.x + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 8174497233233282343, guid: d9e84b5a8037fd946aa503a059fee93f, type: 3} + propertyPath: m_AnchorMax.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 8174497233233282343, guid: d9e84b5a8037fd946aa503a059fee93f, type: 3} + propertyPath: m_AnchorMin.x + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 8174497233233282343, guid: d9e84b5a8037fd946aa503a059fee93f, type: 3} + propertyPath: m_AnchorMin.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 8174497233233282343, guid: d9e84b5a8037fd946aa503a059fee93f, type: 3} + propertyPath: m_SizeDelta.x + value: 100 + objectReference: {fileID: 0} + - target: {fileID: 8174497233233282343, guid: d9e84b5a8037fd946aa503a059fee93f, type: 3} + propertyPath: m_SizeDelta.y + value: 100 + objectReference: {fileID: 0} + - target: {fileID: 8174497233233282343, guid: d9e84b5a8037fd946aa503a059fee93f, type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8174497233233282343, guid: d9e84b5a8037fd946aa503a059fee93f, type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8174497233233282343, guid: d9e84b5a8037fd946aa503a059fee93f, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8174497233233282343, guid: d9e84b5a8037fd946aa503a059fee93f, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 8174497233233282343, guid: d9e84b5a8037fd946aa503a059fee93f, type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8174497233233282343, guid: d9e84b5a8037fd946aa503a059fee93f, type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8174497233233282343, guid: d9e84b5a8037fd946aa503a059fee93f, type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8174497233233282343, guid: d9e84b5a8037fd946aa503a059fee93f, type: 3} + propertyPath: m_AnchoredPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8174497233233282343, guid: d9e84b5a8037fd946aa503a059fee93f, type: 3} + propertyPath: m_AnchoredPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8174497233233282343, guid: d9e84b5a8037fd946aa503a059fee93f, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8174497233233282343, guid: d9e84b5a8037fd946aa503a059fee93f, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8174497233233282343, guid: d9e84b5a8037fd946aa503a059fee93f, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8947839890988736513, guid: d9e84b5a8037fd946aa503a059fee93f, type: 3} + propertyPath: m_AnchorMax.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 8947839890988736513, guid: d9e84b5a8037fd946aa503a059fee93f, type: 3} + propertyPath: m_AnchorMin.y + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 8947839890988736513, guid: d9e84b5a8037fd946aa503a059fee93f, type: 3} + propertyPath: m_AnchoredPosition.x + value: 18 + objectReference: {fileID: 0} + - target: {fileID: 8947839890988736513, guid: d9e84b5a8037fd946aa503a059fee93f, type: 3} + propertyPath: m_AnchoredPosition.y + value: -5 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: d9e84b5a8037fd946aa503a059fee93f, type: 3} +--- !u!1 &2424565416812693168 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 2542652557800958703, guid: d9e84b5a8037fd946aa503a059fee93f, type: 3} + m_PrefabInstance: {fileID: 210710825179524191} + m_PrefabAsset: {fileID: 0} +--- !u!224 &8330882562871208312 stripped +RectTransform: + m_CorrespondingSourceObject: {fileID: 8174497233233282343, guid: d9e84b5a8037fd946aa503a059fee93f, type: 3} + m_PrefabInstance: {fileID: 210710825179524191} + m_PrefabAsset: {fileID: 0} diff --git a/org.mixedrealitytoolkit.uxcomponents/package.json b/org.mixedrealitytoolkit.uxcomponents/package.json index 0fdc03477..a58eca795 100644 --- a/org.mixedrealitytoolkit.uxcomponents/package.json +++ b/org.mixedrealitytoolkit.uxcomponents/package.json @@ -1,6 +1,6 @@ { "name": "org.mixedrealitytoolkit.uxcomponents", - "version": "3.2.0-development", + "version": "3.3.0-development", "description": "MRTK UX component library, leveraging RectTransform/Canvas for dynamic layout and presentation. Contains prefabs, visuals, pre-made controls, and everything to get started building 3D user interfaces for mixed reality.", "displayName": "MRTK UX Components", "msftFeatureCategory": "MRTK3", From 48f45249b456c94c32ce3b9a9911a9a32233b834 Mon Sep 17 00:00:00 2001 From: Risto Rangel Kuoppa Date: Wed, 14 Feb 2024 17:15:58 -0800 Subject: [PATCH 2/3] Updating CHANGELOG.md --- org.mixedrealitytoolkit.uxcomponents/CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/org.mixedrealitytoolkit.uxcomponents/CHANGELOG.md b/org.mixedrealitytoolkit.uxcomponents/CHANGELOG.md index 17b35b40f..c9d75a768 100644 --- a/org.mixedrealitytoolkit.uxcomponents/CHANGELOG.md +++ b/org.mixedrealitytoolkit.uxcomponents/CHANGELOG.md @@ -2,8 +2,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). -## [3.2.0-development] - 2024-02-04 +## [3.3.0-development] - 2024-02-14 ### Fixed * Fixed support for UPM package publishing in the Unity Asset Store. +* Fixed Bug 643 - Experimental SimpleEmptyButton and SimpleActionButton prefabs have missing "See It Say It Label" GameObject reference \ No newline at end of file From 1e1772b13ae28b27e68684459f89cbaf0d64a0c2 Mon Sep 17 00:00:00 2001 From: Risto Rangel Kuoppa Date: Wed, 14 Feb 2024 17:53:56 -0800 Subject: [PATCH 3/3] Fixing changelog.md and package version --- org.mixedrealitytoolkit.uxcomponents/CHANGELOG.md | 2 +- org.mixedrealitytoolkit.uxcomponents/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/org.mixedrealitytoolkit.uxcomponents/CHANGELOG.md b/org.mixedrealitytoolkit.uxcomponents/CHANGELOG.md index c9d75a768..1530b45f3 100644 --- a/org.mixedrealitytoolkit.uxcomponents/CHANGELOG.md +++ b/org.mixedrealitytoolkit.uxcomponents/CHANGELOG.md @@ -2,7 +2,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). -## [3.3.0-development] - 2024-02-14 +## [3.2.0-development] - 2024-02-04 ### Fixed diff --git a/org.mixedrealitytoolkit.uxcomponents/package.json b/org.mixedrealitytoolkit.uxcomponents/package.json index a58eca795..0fdc03477 100644 --- a/org.mixedrealitytoolkit.uxcomponents/package.json +++ b/org.mixedrealitytoolkit.uxcomponents/package.json @@ -1,6 +1,6 @@ { "name": "org.mixedrealitytoolkit.uxcomponents", - "version": "3.3.0-development", + "version": "3.2.0-development", "description": "MRTK UX component library, leveraging RectTransform/Canvas for dynamic layout and presentation. Contains prefabs, visuals, pre-made controls, and everything to get started building 3D user interfaces for mixed reality.", "displayName": "MRTK UX Components", "msftFeatureCategory": "MRTK3",