RemoteObiturator
A class in Root.Township, Alta.ScreenshotCamera.
The hand camera's detachable remote. It sits in a slot on the camera; the owner pulls it out to use as a remote shutter and puts it back by bringing it close. Slot state is synced.
- Listed in Customization and screenshots
- Inherits or implements
MonoBehaviour
Constructors
| Member | What it is |
|---|---|
RemoteObiturator() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
13 private and internal fields
| Member | What it is |
|---|---|
private float distanceToDeslotSquared | Squared hand movement needed to pull the remote out of the slot. |
private float distanceToReslotSquared | Squared distance from the slot at which a held remote snaps back. |
private Pickup fakePickup | Pickup grabbed while the remote is slotted, used to detect pulling it out. |
private HandCamera handCamera | The camera this remote belongs to. |
private bool isSloted | True while the remote is in its slot. Synced. |
private ItemLevitator levitator | Item levitator for the remote, blocked from hovering while slotted. |
private float maxDistanceFromCameraSquared | Squared distance from the camera beyond which the remote returns to the slot. |
private Coroutine movementCheck | The running detach or slot check coroutine. |
private Pickup pickup | The real remote pickup used once unslotted. |
private RendererGroup rendererGroup | Renderers hidden during hand camera renders. |
private Transform slot | Transform on the camera where the remote sits. |
private MethodSync syncSnap | Method sync for the slotted flag. |
private IUnityUpdateMethod updateDistance | Budgeted update registration for UpdateDistance while unslotted. |
Methods
18 private and internal methods
| Member | What it is |
|---|---|
private void Awake() | Hooks interaction filters, grab and release events, hover check, camera entity init and (off headless) photo render events. |
private IEnumerator CheckDetach(Interactor interactor) (iterator) | Coroutine while the slotted fake pickup is held: once the hand moves far enough, unslots the remote and swaps the grab to the real pickup. |
private void CheckHover(ref bool isValid) | Stops the levitator hovering the remote while it is slotted. |
private IEnumerator CheckSlot(Interactor interactor) (iterator) | Coroutine while the real pickup is held: adds the shutter action and snaps back to the slot when the hand nears it. |
private void EndCheck(Interactable interactable, Interactor interactor) | On release, stops the check coroutine and removes the shutter and long photo haptic hooks. |
private void FakeInteractionFilter(Interactor interactor, Interactable interactable, ref bool result) | Only lets the camera owner grab the fake pickup, and only while slotted. |
private void Initialize(NetworkEntity entity) | Clears the pickup's override parent and creates the slot sync. |
private void InteractionFilter(Interactor interactor, Interactable interactable, ref bool result) | Only lets the camera owner grab the real pickup, and only while unslotted. |
private void OnDestroy() | Unhooks render events and the distance check. |
private void OnTakingPhoto(HandCamera handCamera, HandCameraEvent cameraEvent) | Hides the remote's renderers before a hand camera renders. |
private void OnTookPhoto(HandCamera handCamera, HandCameraEvent cameraEvent) | Shows the remote's renderers again after rendering. |
private void SnapPickup() | Makes the pickup kinematic, parents it to the slot and turns off its colliders. |
private void SnapToSlot() | Slots the remote: stops hovering, syncs, force drops the pickup and snaps it on clients. |
private void StartDetachCheck(Interactable interactable, Interactor interactor) | Starts CheckDetach when a local hand grabs the fake pickup. |
private void StartSlotCheck(Interactable interactable, Interactor interactor) | Starts CheckSlot and long photo haptics when a local hand grabs the real pickup. |
private void SyncSnap(IPlayer player, Stream stream) | Syncs the slotted flag. Receivers snap or free the pickup; the server relays it to the chunk. |
private void TogglePickupColliders(bool isEnabled) | Turns the real pickup's colliders on or off. |
private void UpdateDistance() | Snaps the remote back to the slot if it gets too far from the camera. |
Used in
Members of other types that take, return or hold a RemoteObiturator: