Skip to main content

BlockableCamera

An abstract class in Root.Township, Alta.ScreenshotCamera.

Base for a hand camera view that switches its camera off while something is in the way (a sphere or capsule check, in the subclasses). Client side.

Constructors​

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

Fields​

3 private and internal fields
MemberWhat it is
private PostProcessLayer postProcessLayerBacking field for PostProcessLayer.
private HandCameraSettings settingsHand camera settings. Supplies the layer mask used to test for blocking.
private Camera targetCameraBacking field for TargetCamera, the camera turned off while blocked.

Properties​

MemberWhat it is
bool IsBlocked { get; private set; }True while the camera is blocked and turned off.
PostProcessLayer PostProcessLayer { get; }The camera's post processing layer.
Camera TargetCamera { get; }The camera being switched.
protected LayerMask LayerMask { get; }Layers that block the camera, from the hand camera settings.

Methods​

MemberWhat it is
void SetEnabled(bool isEnabled)Turns the camera off, or on if nothing blocks it.
void UpdateBlock()Checks for blocking and turns the camera on or off when that changes.
protected abstract bool UpdateBlockInternal()Returns true if something blocks the camera now.

Used in​

Members of other types that take, return or hold a BlockableCamera: