Skip to main content

AltaPxrManagerCameraController

A class in Root.Township, the global namespace.

Client component that points a Pico XR manager's EyeCamera property at Camera.main whenever the local player changes. Works by reflection so it doesn't need the Pico SDK types.

Constructors​

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

Fields​

3 private and internal fields
MemberWhat it is
private PropertyInfo eyeCameraFieldInfoCached PropertyInfo for the manager's EyeCamera property.
private const string EyeCameraFieldNameName of the property it sets on the manager: EyeCamera.
private MonoBehaviour pxrManagerThe Pico XR manager component, set in the inspector and typed only as MonoBehaviour.

Methods​

3 private and internal methods
MemberWhat it is
private void CacheEyeCameraFieldInfo()Looks up the EyeCamera property on the manager's type by reflection and caches it. Called from Start.
private void OnPlayerControllerChanged(PlayerController playerController)Handler for PlayerController.CurrentPlayerChanged: sets the manager's eye camera to Camera.main.
private void Start()Caches the property, subscribes to player changes and applies once if a local player already exists.