API reference
API reference
Select your platform
No SDKs available
No versions available

AssertUtils Class

Overview

Static Fields

static const string

Static Public Member Functions

static void
AssertIsTrue
( this Component component,
bool value,
string whyItFailed,
string whereItFailed,
string howToFix )
Asserts that the expression is True.
static void
AssertAspect< TValue >
( this Component component,
TValue aspect,
string aspectLocation,
string whyItFailed,
string whereFailed,
string howToFix )
Asserts that an Aspect exists.
static void
AssertField< TValue >
( this Component component,
TValue value,
string variableName,
string whyItFailed,
string whereItFailed,
string howToFix )
Asserts that a Serialized Field in a Component is not null.
static void
AssertCollectionField< TValue >
( this Component component,
IEnumerable< TValue > value,
string variableName,
string whyItFailed,
string whereFailed,
string howToFix )
Asserts that a Serialized collection in a Component is not null, is not empty and all of its items exist.
static void
AssertCollectionItems< TValue >
( this Component component,
IEnumerable< TValue > value,
string variableName,
string whyItFailed,
string whereItFailed,
string howToFix )
Asserts that each item in a Serialized collection in a Component is not null.
static string
Nicify
( string variableName )
Make a displayable name for a variable.

Details

Public Statics

const string Oculus.Interaction.AssertUtils.HiglightColor
No description available.

Static Member Functions

static void Oculus.Interaction.AssertUtils.AssertIsTrue
( this Component component,
bool value,
string whyItFailed,
string whereItFailed,
string howToFix )
Asserts that the expression is True.
In case of failure, it will print an error showing where the failure happened.
Parameters
component
The component to which the value expression belongs
value
The expression that should be true
whyItFailed
Optional parameter specifying the reason the assert failed
whereItFailed
Optional parameter specifying where the failure can be found. If none is provided it will print the component address (GameObject->Component).
howToFix
Optional parameter suggesting how to fix the problem.
static void Oculus.Interaction.AssertUtils.AssertAspect< TValue >
( this Component component,
TValue aspect,
string aspectLocation,
string whyItFailed,
string whereFailed,
string howToFix )
Asserts that an Aspect exists.
In case of failure, it will print an error showing why it failed, where it failed and suggest how to fix it.
Others
TValue
The type of Aspect to be checked
Parameters
component
The component requiring this Aspect
aspect
The Aspect to be checked
aspectLocation
The expected location of the Aspect
whyItFailed
Optional parameter specifying the reason the assert failed. If none is provided it will print the expected aspect type and location.
whereFailed
Optional parameter specifying where the failure can be found. If none is provided it will print the component address (GameObject->Component).
howToFix
Optional parameter suggesting how to fix the problem. If none is provided it will suggest assigning an Aspect of the required type to the expected location.
static void Oculus.Interaction.AssertUtils.AssertField< TValue >
( this Component component,
TValue value,
string variableName,
string whyItFailed,
string whereItFailed,
string howToFix )
Asserts that a Serialized Field in a Component is not null.
In case of failure, it will print an error showing why it failed, where it failed and suggest how to fix it.
Others
TValue
The type of field to be checked
Parameters
component
The component to which this field belongs.
value
The value of the field.
variableName
The printed name of the serialized field.
whyItFailed
Optional parameter specifying the reason the assert failed. If none is provided it will indicate that the field value was null.
whereItFailed
Optional parameter specifying where the failure can be found. If none is provided it will print the component address (GameObject->Component->Field Name).
howToFix
Optional parameter suggesting how to fix the problem. If none is provided it will suggest assigning a value of the required type to the field.
static void Oculus.Interaction.AssertUtils.AssertCollectionField< TValue >
( this Component component,
IEnumerable< TValue > value,
string variableName,
string whyItFailed,
string whereFailed,
string howToFix )
Asserts that a Serialized collection in a Component is not null, is not empty and all of its items exist.
In case of failure, it will print an error showing why it failed, where it failed and suggest how to fix it.
Others
TValue
The type of the items in the collection.
Parameters
component
The component to which this collection belongs.
value
The value of the collection.
variableName
The printed name of the serialized collection.
whyItFailed
Optional parameter specifying the reason the assert failed. If none is provided it will indicate that the collection value needs at least one valid item.
whereFailed
Optional parameter specifying where the failure can be found. If none is provided it will print the component address (GameObject->Component->Collection Name).
howToFix
Optional parameter suggesting how to fix the problem. If none is provided it will suggest assigning at least one valid item of the required type to the collection.
static void Oculus.Interaction.AssertUtils.AssertCollectionItems< TValue >
( this Component component,
IEnumerable< TValue > value,
string variableName,
string whyItFailed,
string whereItFailed,
string howToFix )
Asserts that each item in a Serialized collection in a Component is not null.
Note that the collection it might contain 0 items. In case of failure, it will print an error showing why it failed, where it failed and suggest how to fix it.
Others
TValue
The type of the items in the collection
Parameters
component
The component to which the collection belongs.
value
The value of the collection.
variableName
The printed name of the serialized collection.
whyItFailed
Optional parameter specifying the reason the assert failed. If none is provided it will indicate, for each failed item, that the item must not be null.
whereItFailed
Optional parameter specifying where the failure can be found. If none is provided it will print the component address (GameObject->Component->Collection Name).
howToFix
Optional parameter suggesting how to fix the problem. If none is provided it will suggest assigning a valid item of the required type to the collection at each missing index.
static string Oculus.Interaction.AssertUtils.Nicify
( string variableName )
Make a displayable name for a variable.
This function will insert spaces before capital letters and remove optional m_, _ or k followed by uppercase letter in front of the name.
Parameters
variableName
The variable name as used in code
Returns
The nicified variable