Skip to main content

LoadingObject

A class in Root.Township, the global namespace.

Client VR loading screen object: keeps an overlay at floor height under the headset and turns it slowly to face where the player looks.

Constructors​

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

Fields​

8 private and internal fields
MemberWhat it is
private Transform cachedTransformTransform moved down by the headset height.
private Transform cameraTransformTransform that follows the headset.
private bool isRotatingTrue until the overlay has caught up with the view direction.
private Quaternion lastRotationCurrent eased rotation of rotatingTransform.
private MonoBehaviour ovrOverlayOverlay component, enabled on the first update.
private Vector3 positionReused local position for cachedTransform.
private Transform rotatingTransformTransform turned to face the view direction.
private VRTrackedDevice vrTrackedDeviceHeadset tracking handle from VRTrackedDevice.AddTracking.

Methods​

3 private and internal methods
MemberWhat it is
private void Awake()Starts tracking the headset onto cameraTransform.
private void OnDestroy()Disposes the headset tracking.
private void Update()Offsets the object by the headset height, snaps the overlay to the view direction the first frame, then eases toward it until within 5 degrees.