Class EyeTrackingDemoUtils
General useful utility functions.
Inherited Members
Namespace: Microsoft.MixedReality.Toolkit.Examples.Demos.EyeTracking
Assembly: cs.temp.dll.dll
Syntax
public static class EyeTrackingDemoUtils
Methods
GameObject_ChangeColor(GameObject, Color, ref Nullable<Color>, Boolean)
Change the color of game object "gobj".
Declaration
public static void GameObject_ChangeColor(GameObject gobj, Color newColor, ref Color? originalColor, bool onlyApplyToRootObj)
Parameters
Type | Name | Description |
---|---|---|
GameObject | gobj | |
Color | newColor | |
Nullable<Color> | originalColor | Enter "null" in case you're passing the original object and want to save the original color. |
Boolean | onlyApplyToRootObj |
GameObject_ChangeColor(GameObject, Color, ref Nullable<Color>, Boolean)
Change the color of game object "gobj".
Declaration
public static void GameObject_ChangeColor(GameObject gobj, Color newColor, ref Color? originalColor, bool onlyApplyToRootObj)
Parameters
Type | Name | Description |
---|---|---|
GameObject | gobj | |
Color | newColor | |
Nullable<Color> | originalColor | Enter "null" in case you're passing the original object and want to save the original color. |
Boolean | onlyApplyToRootObj |
GameObject_ChangeTransparency(GameObject, Single)
Change the transparency of game object "gobj" with a transparency value between 0 and 1;
Declaration
public static void GameObject_ChangeTransparency(GameObject gobj, float newTransparency)
Parameters
Type | Name | Description |
---|---|---|
GameObject | gobj | |
Single | newTransparency |
GameObject_ChangeTransparency(GameObject, Single)
Change the transparency of game object "gobj" with a transparency value between 0 and 1;
Declaration
public static void GameObject_ChangeTransparency(GameObject gobj, float newTransparency)
Parameters
Type | Name | Description |
---|---|---|
GameObject | gobj | |
Single | newTransparency |
GameObject_ChangeTransparency(GameObject, Single, ref Single)
Change the transparency of game object "gobj" with a transparency value between 0 and 255 with the option to receive the original transparency value back.
Declaration
public static void GameObject_ChangeTransparency(GameObject gobj, float transparency, ref float originalTransparency)
Parameters
Type | Name | Description |
---|---|---|
GameObject | gobj | |
Single | transparency | Expected values range from 0 (fully transparent) to 1 (fully opaque). |
Single | originalTransparency | Input "-1" if you don't know the original transparency yet. |
GameObject_ChangeTransparency(GameObject, Single, ref Single)
Change the transparency of game object "gobj" with a transparency value between 0 and 255 with the option to receive the original transparency value back.
Declaration
public static void GameObject_ChangeTransparency(GameObject gobj, float transparency, ref float originalTransparency)
Parameters
Type | Name | Description |
---|---|---|
GameObject | gobj | |
Single | transparency | Expected values range from 0 (fully transparent) to 1 (fully opaque). |
Single | originalTransparency | Input "-1" if you don't know the original transparency yet. |
GetFullName(GameObject)
Returns the full name of a given GameObject in the scene graph.
Declaration
public static string GetFullName(GameObject go)
Parameters
Type | Name | Description |
---|---|---|
GameObject | go |
Returns
Type | Description |
---|---|
String |
GetFullName(GameObject)
Returns the full name of a given GameObject in the scene graph.
Declaration
public static string GetFullName(GameObject go)
Parameters
Type | Name | Description |
---|---|---|
GameObject | go |
Returns
Type | Description |
---|---|
String |
GetFullName(GameObject, out Boolean)
Returns the full name of a given GameObject in the scene graph.
Declaration
public static string GetFullName(GameObject go, out bool valid)
Parameters
Type | Name | Description |
---|---|---|
GameObject | go | |
Boolean | valid |
Returns
Type | Description |
---|---|
String |
GetFullName(GameObject, out Boolean)
Returns the full name of a given GameObject in the scene graph.
Declaration
public static string GetFullName(GameObject go, out bool valid)
Parameters
Type | Name | Description |
---|---|---|
GameObject | go | |
Boolean | valid |
Returns
Type | Description |
---|---|
String |
GetValidFilename(String)
Returns a correctly formatted filename removing invalid characters if necessary.
Declaration
public static string GetValidFilename(string unvalidatedFilename)
Parameters
Type | Name | Description |
---|---|---|
String | unvalidatedFilename | The unvalidated filename |
Returns
Type | Description |
---|---|
String | Validated filename. |
GetValidFilename(String)
Returns a correctly formatted filename removing invalid characters if necessary.
Declaration
public static string GetValidFilename(string unvalidatedFilename)
Parameters
Type | Name | Description |
---|---|---|
String | unvalidatedFilename | The unvalidated filename |
Returns
Type | Description |
---|---|
String | Validated filename. |
LoadNewScene(String)
Loads a Unity scene with the given name.
Declaration
public static IEnumerator LoadNewScene(string sceneToBeLoaded)
Parameters
Type | Name | Description |
---|---|---|
String | sceneToBeLoaded | Name of the scene to be loaded. |
Returns
Type | Description |
---|---|
IEnumerator |
LoadNewScene(String)
Loads a Unity scene with the given name.
Declaration
public static IEnumerator LoadNewScene(string sceneToBeLoaded)
Parameters
Type | Name | Description |
---|---|---|
String | sceneToBeLoaded | Name of the scene to be loaded. |
Returns
Type | Description |
---|---|
IEnumerator |
LoadNewScene(String, Single)
Loads a Unity scene with the given name after a given delay in seconds.
Declaration
public static IEnumerator LoadNewScene(string sceneToBeLoaded, float delayInSeconds)
Parameters
Type | Name | Description |
---|---|---|
String | sceneToBeLoaded | Name of the scene to be loaded. |
Single | delayInSeconds | Delay in seconds to wait before loading the new scene. |
Returns
Type | Description |
---|---|
IEnumerator |
LoadNewScene(String, Single)
Loads a Unity scene with the given name after a given delay in seconds.
Declaration
public static IEnumerator LoadNewScene(string sceneToBeLoaded, float delayInSeconds)
Parameters
Type | Name | Description |
---|---|---|
String | sceneToBeLoaded | Name of the scene to be loaded. |
Single | delayInSeconds | Delay in seconds to wait before loading the new scene. |
Returns
Type | Description |
---|---|
IEnumerator |
Normalize(Single, Single, Single)
Normalize the given value based on the provided min and max values.
Declaration
public static float Normalize(float value, float min, float max)
Parameters
Type | Name | Description |
---|---|---|
Single | value | |
Single | min | |
Single | max |
Returns
Type | Description |
---|---|
Single |
Normalize(Single, Single, Single)
Normalize the given value based on the provided min and max values.
Declaration
public static float Normalize(float value, float min, float max)
Parameters
Type | Name | Description |
---|---|---|
Single | value | |
Single | min | |
Single | max |
Returns
Type | Description |
---|---|
Single |
RandomizeListOrder<T>(T[])
Shuffles the entries in a given array and returns the shuffled array.
Declaration
public static T[] RandomizeListOrder<T>(T[] array)
Parameters
Type | Name | Description |
---|---|---|
T[] | array |
Returns
Type | Description |
---|---|
T[] |
Type Parameters
Name | Description |
---|---|
T |
RandomizeListOrder<T>(T[])
Shuffles the entries in a given array and returns the shuffled array.
Declaration
public static T[] RandomizeListOrder<T>(T[] array)
Parameters
Type | Name | Description |
---|---|---|
T[] | array |
Returns
Type | Description |
---|---|
T[] |
Type Parameters
Name | Description |
---|---|
T |
VisAngleInDegreesToMeters(Single, Single)
Computes the metric size (in meters) for a given visual angle size.
Declaration
public static float VisAngleInDegreesToMeters(float visAngleInDegrees, float distInMeters)
Parameters
Type | Name | Description |
---|---|---|
Single | visAngleInDegrees | In degrees. |
Single | distInMeters | In meters. |
Returns
Type | Description |
---|---|
Single |
VisAngleInDegreesToMeters(Single, Single)
Computes the metric size (in meters) for a given visual angle size.
Declaration
public static float VisAngleInDegreesToMeters(float visAngleInDegrees, float distInMeters)
Parameters
Type | Name | Description |
---|---|---|
Single | visAngleInDegrees | In degrees. |
Single | distInMeters | In meters. |
Returns
Type | Description |
---|---|
Single |
VisAngleInDegreesToMeters(Vector3, Single)
Returns the metric size in meters of a given Vector3 in visual angle in degrees and a given viewing distance in meters.
Declaration
public static Vector3 VisAngleInDegreesToMeters(Vector3 visAngleInDegrees, float distInMeters)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | visAngleInDegrees | In degrees. |
Single | distInMeters | In meters. |
Returns
Type | Description |
---|---|
Vector3 |
VisAngleInDegreesToMeters(Vector3, Single)
Returns the metric size in meters of a given Vector3 in visual angle in degrees and a given viewing distance in meters.
Declaration
public static Vector3 VisAngleInDegreesToMeters(Vector3 visAngleInDegrees, float distInMeters)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | visAngleInDegrees | In degrees. |
Single | distInMeters | In meters. |
Returns
Type | Description |
---|---|
Vector3 |