book_4_sparkGenerated
code_blocksInput

Description

The TrackedDeviceType.Invalid field is a member of the TrackedDeviceType enumeration within the Sandbox.VR namespace. It represents an invalid or unrecognized tracked device type. This value is typically used as a default or error state when a valid device type cannot be determined.

Usage

Use TrackedDeviceType.Invalid when you need to handle cases where a device type is not recognized or is invalid. This can be useful for error checking or default case handling in switch statements.

Example

// Example of using TrackedDeviceType.Invalid in a switch statement
TrackedDeviceType deviceType = GetDeviceType();

switch (deviceType)
{
    case TrackedDeviceType.Hmd:
        // Handle head-mounted display
        break;
    case TrackedDeviceType.Controller:
        // Handle controller
        break;
    case TrackedDeviceType.Tracker:
        // Handle tracker
        break;
    case TrackedDeviceType.BaseStation:
        // Handle base station
        break;
    case TrackedDeviceType.Redirect:
        // Handle redirect
        break;
    case TrackedDeviceType.Invalid:
    default:
        // Handle invalid or unrecognized device type
        break;
}