Class TestButtonUtilities
Utility class that provides helpful methods for generating and assembling buttons to be used in tests
Also provides functions to test/simulate pressing buttons etc
Inheritance
TestButtonUtilities
Assembly: cs.temp.dll.dll
public static class TestButtonUtilities
Fields
Amount of time for press action on button
Declaration
public const float ButtonPressAnimationDelay = 0.25F
Field Value
Amount of time for release action on button
Declaration
public const float ButtonReleaseAnimationDelay = 0.25F
Field Value
Asset path to default model push button prefab asset
Declaration
public static readonly string DefaultInteractablePrefabAssetPath
Field Value
Default position of new interactable buttons instantiated
Declaration
public static readonly Vector3 DefaultPosition
Field Value
Default rotation applied to new interactable button instantiated
Declaration
public static readonly Quaternion DefaultRotation
Field Value
Type |
Description |
Quaternion |
|
Asset path to default HoloLens 2 Pressable Button prefab asset
Declaration
public static readonly string PressableHoloLens2PrefabPath
Field Value
Asset path to default HoloLens 2 Toggle Pressable Button prefab asset
Declaration
public static readonly string PressableHoloLens2TogglePrefabPath
Field Value
Methods
Confirms that provided Transform translates as expected due to a press currently happening
Declaration
public static IEnumerator CheckButtonTranslation(Vector3 targetStartPosition, Transform translateTarget, bool shouldTranslate = true)
Parameters
Type |
Name |
Description |
Vector3 |
targetStartPosition |
|
Transform |
translateTarget |
|
Boolean |
shouldTranslate |
|
Returns
Type |
Description |
IEnumerator |
|
Declaration
public static void InstantiateDefaultButton(TestButtonUtilities.DefaultButtonType buttonType, out Interactable interactable, out Transform translateTargetObject)
Parameters
Instantiates Interactable prefab from provided asset database path at given position and rotation
Declaration
public static GameObject InstantiateInteractableFromPath(Vector3 position, Quaternion rotation, string path)
Parameters
Type |
Name |
Description |
Vector3 |
position |
|
Quaternion |
rotation |
|
String |
path |
|
Returns
Type |
Description |
GameObject |
|
Instantiates Pressable Button based on list of arguments provided
Declaration
public static void InstantiatePressableButtonPrefab(Vector3 position, Quaternion rotation, string prefabPath, string translateTargetPath, out Interactable interactable, out Transform translateTargetTransform)
Parameters
Type |
Name |
Description |
Vector3 |
position |
|
Quaternion |
rotation |
|
String |
prefabPath |
|
String |
translateTargetPath |
|
Interactable |
interactable |
|
Transform |
translateTargetTransform |
|
Move the right hand from point 1 to point 2
Declaration
public static IEnumerator MoveHand(Vector3 p1, Vector3 p2)
Parameters
Type |
Name |
Description |
Vector3 |
p1 |
|
Vector3 |
p2 |
|
Returns
Type |
Description |
IEnumerator |
|
Move the right from in the button to just in front of the button
Declaration
public static IEnumerator MoveHandAwayFromButton(Transform button)
Parameters
Type |
Name |
Description |
Transform |
button |
|
Returns
Type |
Description |
IEnumerator |
|
Move the right hand from in front of the button through to the button
Declaration
public static IEnumerator MoveHandToButton(Transform button)
Parameters
Type |
Name |
Description |
Transform |
button |
|
Returns
Type |
Description |
IEnumerator |
|
Execute and test end-to-end press of a button with right hand poke pointer
Declaration
public static IEnumerator TestClickPushButton(Transform button, Vector3 targetStartPosition, Transform translateTargetObject, bool shouldClick = true)
Parameters
Type |
Name |
Description |
Transform |
button |
Position of button to push hand to/through
|
Vector3 |
targetStartPosition |
The start position of the button component that will translate on press
|
Transform |
translateTargetObject |
Transform of the button component that will translate on press
|
Boolean |
shouldClick |
Should we expect a click (i.e translation) from the button. The button may be disabled
|
Returns
Type |
Description |
IEnumerator |
|