| TSharedFromThis
|
Module |
|
Header |
/Engine/Source/Editor/UnrealEd/Public/EditorModeRegistry.h |
Include |
#include "EditorModeRegistry.h" |
struct IEditorModeFactory : public TSharedFromThis< IEditorModeFactory >
Class responsible for maintaining a list of registered editor mode types.
Example usage:
Register your mode type with: FEditorModeRegistry::Get().RegisterMode<FMyEditorMode>( FName ) ); or: class FMyEditorModeFactory : public IEditorModeFactory { virtual void OnSelectionChanged( FEditorModeTools& Tools, UObject* ItemUndergoingChange ) const override; virtual FEditorModeInfoGetModeInfo() const override; virtual TSharedRef<FEdMode> CreateMode() const override; }; TSharedRef<FMyEditorModeFactory> Factory = MakeShareable( new FMyEditorModeFactory ); FEditorModeRegistry::Get().RegisterMode( FName ), Factory );
Unregister your mode when it is no longer available like so (this will prompt the destruction of any existing modes of this type): FEditorModeRegistry::Get().UnregisterMode( FName ) );
Name | Description | |
---|---|---|
|
~IEditorModeFactory() |
Virtual destructor |
Name | Description | ||
---|---|---|---|
|
TSharedRef< ... |
CreateMode() |
Create a new instance of our mode |
|
FEditorModeI... |
GetModeInfo() |
Gets the information pertaining to the mode type that this factory creates |
|
OnSelectionChanged ( |
Allows mode factories to handle selection change events, and potentially activate/deactivate modes |