Skip to main content

VisibilityTrigger

A class in Root.Township, Alta.ScreenshotCamera.

Reports when a renderer on this object becomes visible or invisible to any camera.

Constructors​

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

Properties​

MemberWhat it is
bool IsVisible { get; private set; }Whether the renderer is currently visible to some camera.

Events​

MemberWhat it is
event Action<bool> VisibilityUpdatedRaised with the new visibility. It is invoked without a null check, so it throws if nothing is subscribed.

Methods​

2 private and internal methods
MemberWhat it is
private void OnBecameInvisible()Unity callback. Sets IsVisible false and raises VisibilityUpdated.
private void OnBecameVisible()Unity callback. Sets IsVisible true and raises VisibilityUpdated.

Used in​

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