Description
The Type
property of the TrackedObject
class indicates the type of VR device being tracked. This could be a tracker, controller, or other types of VR devices. It is used to identify the specific kind of device that the TrackedObject
instance represents.
Usage
To access the Type
property, you need to have an instance of the TrackedObject
class. You can then read the property to determine the type of device being tracked.
Example
// Example of accessing the Type property of a TrackedObject
TrackedObject trackedObject = new TrackedObject();
Sandbox.VR.TrackedDeviceType deviceType = trackedObject.Type;
// Check the type of the tracked device
if (deviceType == Sandbox.VR.TrackedDeviceType.Controller)
{
// Handle controller-specific logic
}
else if (deviceType == Sandbox.VR.TrackedDeviceType.Tracker)
{
// Handle tracker-specific logic
}