Skip to main content

VRPlayerController

An abstract class in Root.Township, the global namespace.

Base player controller for VR. When linked to the local player it adds vision comfort and HMD tracking.

Constructors​

MemberWhat it is
protected VRPlayerController()Unity makes components itself; use AddComponent or spawn a prefab instead of new.

Fields​

3 private and internal fields
MemberWhat it is
private IPlatformDevice platformDeviceInjected platform device, passed to vision comfort.
private PlayerVisionComfort visionComfortVision comfort handler for the local player, or null.
private VRTrackedDevice vrTrackedDeviceHMD tracking on the camera for the local player, or null.

Methods​

MemberWhat it is
void InjectPlatformDevice(IPlatformDevice platformDevice)VContainer injection point for the platform device.
protected override void Awake()Hooks the linked-to-local-player event.
protected override void OnDestroy()Disposes the HMD tracking and vision comfort.
1 private and internal method
MemberWhat it is
private void Linked()For the local player, creates the vision comfort handler and starts HMD tracking on the camera.