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

BoolMonitor Class

Simple helper class used to observe a simple closure and report its behavior over time.
BoolMonitor is used by OVRControllerTest to conveniently serialize controller behavior into a human-readable format. For example, a test of OVRInput.Button.One will observe OVRInput.Get(OVRInput.Button, OVRInput.Controller) with that input, displaying the monitor's name and current state in the format, "One: *True*," etc.

Member Functions

The closure type observed by by this BoolMonitor over time.
BoolMonitor(string, BoolGenerator, float) is typically invoked with an anonymous function as its second argument, which will be interpreted as this type.
Returns
Constructor for BoolMonitor.
Parameters
name
The display name of the closure being monitored
generator
The closure to be monitored
displayTimeout
Optional parameter controlling how long after changing the display text for this monitor will remain emphasized
Updates the BoolMonitor's state.
This invokes the BoolGenerator closure passed to this instance at construction, then updates the monitor's internal state based on whether and when the result of the closure changed.
Serializes the current state of the monitor into a StringBuilder to be displayed.
This is a non-modifying function and does not actually update the current state; to update state, a separate call to Update must be made.
Parameters
sb
The string builder to which the serialization should be appended
Did you find this page helpful?
Thumbs up icon
Thumbs down icon