VisibleOnScreenEnabler3D
A box-shaped region of 3D space that, when visible on screen, enables a target node.
A box-shaped region of 3D space that, when visible on screen, enables a target node.
VisibleOnScreenEnabler3D contains a box-shaped region of 3D space and a target node. The target node will be automatically enabled (via its Entity.ProcessMode property) when any part of this region becomes visible on the screen, and automatically disabled otherwise. This can for example be used to activate enemies only when the player approaches them.
See VisibleOnScreenNotifier3D if you only want to be notified when the region is visible on screen.
Note: VisibleOnScreenEnabler3D uses an approximate heuristic that doesn't take walls and other occlusion into account, unless occlusion culling is used. It also won't function unless Entity3D.Visible is set to true.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
VisibleOnScreenEnabler3DConstructor
public VisibleOnScreenEnabler3D();Properties2
EnableEntityPathProperty
public EntityPath EnableEntityPath { get; set; }The path to the target node, relative to the VisibleOnScreenEnabler3D. The target node is cached; it's only assigned when setting this property (if the VisibleOnScreenEnabler3D is inside the scene tree) and every time the VisibleOnScreenEnabler3D enters the scene tree. If the path is empty, no node will be affected. If the path is invalid, an error is also generated.
EnableModeProperty
public VisibleOnScreenEnabler3D.EnableModeEnum EnableMode { get; set; }Determines how the target node is enabled. Corresponds to Entity.ProcessModeEnum. When the node is disabled, it always uses Entity.ProcessModeEnum.Disabled.
Methods4
GetEnableEntityPathEntityPath
public EntityPath GetEnableEntityPath();EntityPathGetEnableModeVisibleOnScreenEnabler3D.EnableModeEnum
public VisibleOnScreenEnabler3D.EnableModeEnum GetEnableMode();VisibleOnScreenEnabler3D.EnableModeEnumSetEnableEntityPathvoid
public void SetEnableEntityPath(EntityPath path);| Name | Type | Default |
|---|---|---|
path | EntityPath | — |
SetEnableModevoid
public void SetEnableMode(VisibleOnScreenEnabler3D.EnableModeEnum mode);| Name | Type | Default |
|---|---|---|
mode | VisibleOnScreenEnabler3D.EnableModeEnum | — |
VisibleOnScreenEnabler3D.EnableModeEnum
| Value | Description |
|---|---|
Always = 1 | Corresponds to |
Inherit = 0 | Corresponds to |
WhenPaused = 2 | Corresponds to |