Navigation
API > API/Plugins > API/Plugins/ModelingComponentsEditorOnly > API/Plugins/ModelingComponentsEditorOnly/Scene
Inheritance Hierarchy
- FEditorUndoClient
- FLevelObjectsObserver
References
| Module | ModelingComponentsEditorOnly |
| Header | /Engine/Plugins/Runtime/MeshModelingToolset/Source/ModelingComponentsEditorOnly/Public/Scene/LevelObjectsObserver.h |
| Include | #include "Scene/LevelObjectsObserver.h" |
Syntax
class FLevelObjectsObserver : public FEditorUndoClient
Remarks
FLevelObjectsObserver is a utility class that tracks the active-set of Actors in a World, in the Editor, and emits events when the set changes. The goal is to guarantee that:
- OnActorAdded will be emitted when an Actor comes into existence
- OnActorRemoved will be emitted when an Actor ceases to exist (possibly after GC, though)
- these signals will be unique, ie once per Actor
This is a surprisingly complicated problem in the Editor due to the many ways that Actors might be created or destroyed, in particular via Undo/Redo.
Note that it is not possible to guarantee that OnActorRemoved() fires before an Actor is GC'd. So, listeners should maintain TWeakObjectPtr<>'s on Actors if they need to know this information.
Variables
| Type | Name | Description | |
|---|---|---|---|
| TSet< AActor * > | Actors | ||
| FActorAddRemoveSignature | OnActorAdded | OnActorAdded is emitted when a new Actor is detected | |
| FDelegateHandle | OnActorAddedHandle | ||
| FDelegateHandle | OnActorDeletedHandle | ||
| FDelegateHandle | OnActorListChangedHandle | ||
| FActorAddRemoveSignature | OnActorRemoved | OnActorRemoved is emitted when an existing Actor is destroyed. | |
| UWorld * | World |
Destructors
| Type | Name | Description | |
|---|---|---|---|
| Destructor. |
Functions
| Type | Name | Description | |
|---|---|---|---|
| void | HandleActorAddedEvent
(
AActor* Actor |
||
| void | HandleActorDeletedEvent
(
AActor* Actor |
||
| void | Initialize
(
UWorld* WorldIn |
Begin watching WorldIn. This will emit OnActorAdded for all Actors in the World. | |
| void | |||
| void | Shutdown () |
Stop watching WorldIn. |
Overridden from FEditorUndoClient
| Type | Name | Description | |
|---|---|---|---|
| void | PostRedo
(
bool bSuccess |
Signal that client should run any PostRedo code | |
| void | PostUndo
(
bool bSuccess |
FEditorUndoClient implementation. |
Typedefs
| Name | Description |
|---|---|
| FActorAddRemoveSignature |