Skip to content

Commit

Permalink
Bug643-Fix adding missing SeeItSayItLabel, reference corresponding Ga…
Browse files Browse the repository at this point in the history
…meObject, and regression-prevention UnityTests (#646)

* Big643-Fix adding missing SeeItSayItLabel, reference corresponding GameObject, and regression-prevention UnityTests
* Updating CHANGELOG.md
  • Loading branch information
ms-RistoRK authored Feb 20, 2024
1 parent bbdc68f commit 2df2b8d
Show file tree
Hide file tree
Showing 4 changed files with 250 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -908,6 +908,73 @@ public IEnumerator TestPressableButtonIsProximityHoveredPropertyIsOfTypeTimedFla

yield return null;
}

/// <summary>
/// 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
/// </summary>
[UnityTest]
public IEnumerator TestSimpleEmptyButtonHasSeeItSayItLabelComponentAndReferencedGameObjectIsNotNull()
{
// instantiate scene and button
string SimpleEmptyButtonPath = AssetDatabase.GUIDToAssetPath("7ed78718e86d3cc469e6abbecb4a8508");
GameObject testSimpleEmptyButton = InstantiateDefaultPressableButton(SimpleEmptyButtonPath);
yield return null;

SeeItSayItLabelEnabler[] seeItSayitLabelEnablerComponents = testSimpleEmptyButton.GetComponents<SeeItSayItLabelEnabler>();
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;
}

/// <summary>
/// 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
/// </summary>
[UnityTest]
public IEnumerator TestSimpleActionButtonHasSeeItSayItLabelComponentAndReferencedGameObjectIsNotNull()
{
// instantiate scene and button
string SimpleActionButtonPath = AssetDatabase.GUIDToAssetPath("a2b07dcaa4b2f8e4fa68b319f1477f4c");
GameObject testSimpleActionButton = InstantiateDefaultPressableButton(SimpleActionButtonPath);
yield return null;

SeeItSayItLabelEnabler[] seeItSayitLabelEnablerComponents = testSimpleActionButton.GetComponents<SeeItSayItLabelEnabler>();
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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -322,6 +323,14 @@ MonoBehaviour:
rollOffXYDepth: 3
rejectZRollOff: 0
extendSpeed: 0.5
<IsProximityHovered>k__BackingField:
active: 0
onEntered:
m_PersistentCalls:
m_Calls: []
onExited:
m_PersistentCalls:
m_Calls: []
--- !u!114 &1621070622446983610
MonoBehaviour:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -394,6 +403,7 @@ MonoBehaviour:
attachedRectTransform: {fileID: 4636237264255655829}
padding: {x: 0, y: 0}
forceUpdateEveryFrame: 0
canToggleCollider: 1
--- !u!95 &1144530035273243757
Animator:
serializedVersion: 5
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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}
Loading

0 comments on commit 2df2b8d

Please sign in to comment.