Table of Contents

Hider API


FogOfWarHider (namespace FOW) marks an object to be hidden when it falls outside line of sight.

Properties

Property Type Description
SamplePoints Transform[] Points tested for visibility.
PermanentlyReveal bool Stay visible forever once seen.
NumObservers int (read-only) How many revealers currently see this hider.
CurrentObservers List<HiderRevealer> (read-only) The revealer "seekers" currently observing this hider.
CachedTransform Transform (read-only) The hider's cached transform.
CachedPosition float2 (read-only) The hider's cached position on the fog plane.
HiderArrayPosition int (read-only) Index in FogOfWarWorld.ActiveHiders.
HiderPermanantID int (read-only) Stable id for the hider's lifetime.

Methods

RegisterHider / DeregisterHider

public void RegisterHider()
public void DeregisterHider()

Manually add or remove the hider from the system. Normally handled automatically in OnEnable / OnDisable.

UpdateBuckets

public void UpdateBuckets()

Refreshes the hider's spatial-hash buckets from its current sample position. Called by the system during updates.

Events

OnActiveChanged

public delegate void OnChangeActive(bool isActive);
public event OnChangeActive OnActiveChanged;

Raised when the hider's visibility state changes (true = revealed, false = hidden). This is the event that Hider Behaviors subscribe to.

Tip

To react when a specific revealer sees a hider (rather than the hider's overall state), use the revealer's OnHiderVisibilityChanged event instead.