Hider Behaviors
A Hider Behavior decides what happens when its Fog Of War Hider is hidden or revealed. A behavior requires a Fog Of War Hider on the same GameObject. Three behaviors ship with the package, and you can write your own.
Note
A behavior calls On Hide once on Awake, so objects start in their hidden state until a revealer sees them.
Hider Disable Objects
Enables or disables a set of GameObjects.
| Property | Type | Description |
|---|---|---|
| Objects To Hide | GameObject[] | Disabled when hidden, enabled when revealed. |
Method:
// swap the hidden objects at runtime
public void ModifyHiddenObjects(GameObject[] newObjectsToHide)
Hider Disable Renderers
Enables or disables a set of Renderers. Use this instead of Disable Objects when you want to keep the GameObjects active (scripts, colliders) but hide only the visuals.
| Property | Type | Description |
|---|---|---|
| Objects To Hide | Renderer[] | Renderer.enabled is set false when hidden, true when revealed. |
Method:
// swap the hidden renderers at runtime
public void ModifyHiddenRenderers(Renderer[] newObjectsToHide)
Hider Toggle Objects
Swaps one set of objects for another between the revealed and hidden states — for example, showing a "?" marker while hidden and the real unit while revealed.
| Property | Type | Description |
|---|---|---|
| Revealed Objects | GameObject[] | Visible while in line of sight. |
| Hidden Objects | GameObject[] | Visible while out of line of sight. |
Writing Your Own
Subclass HiderBehavior and implement OnReveal() / OnHide(). See Custom Hider Behaviors.