#include <EditorComponentBase.h>
Inherits AZ::Component.
Inherited by AzToolsFramework::Components::EditorComponentAdapter< TController, TRuntimeComponent, TConfiguration >, AzToolsFramework::Components::EditorDisabledCompositionComponent, AzToolsFramework::Components::EditorEntityIconComponent, AzToolsFramework::Components::EditorEntitySortComponent, AzToolsFramework::Components::EditorInspectorComponent, AzToolsFramework::Components::EditorLockComponent, AzToolsFramework::Components::EditorNonUniformScaleComponent, AzToolsFramework::Components::EditorOnlyEntityComponent, AzToolsFramework::Components::EditorPendingCompositionComponent, AzToolsFramework::Components::EditorVisibilityComponent, AzToolsFramework::Components::GenericComponentWrapper, AzToolsFramework::Components::ScriptEditorComponent, AzToolsFramework::Components::SelectionComponent, AzToolsFramework::Components::TransformComponent, AzToolsFramework::Layers::EditorLayerComponent, AzToolsFramework::LocalViewBookmarkComponent, AzToolsFramework::Prefab::EditorPrefabComponent, and AzToolsFramework::SharedViewBookmarkComponent.
Public Member Functions | |
AZ_RTTI (EditorComponentBase, "{D5346BD4-7F20-444E-B370-327ACD03D4A0}", AZ::Component) | |
EditorComponentBase () | |
void | SetDirty () |
virtual void | Init () override |
virtual void | Activate () override |
virtual void | Deactivate () override |
void | OnAfterEntitySet () override final |
void | SetSerializedIdentifier (AZStd::string serializedIdentifier) override final |
AZStd::string | GetSerializedIdentifier () const override final |
AZ::TransformInterface * | GetTransform () const |
AZ::Transform | GetWorldTM () const |
AZ::Transform | GetLocalTM () const |
bool | IsSelected () const |
virtual void | BuildGameEntity (AZ::Entity *) |
virtual void | SetPrimaryAsset (const AZ::Data::AssetId &) |
virtual void | AddContextMenuActions (QMenu *) |
Static Public Member Functions | |
static void | Reflect (AZ::ReflectContext *context) |
Friends | |
class | EditorEntityActionComponent |
class | EditorDisabledCompositionComponent |
class | EditorPendingCompositionComponent |
A base class for all editor components. Derive from this class to create a version of a component to use in the editor, as opposed to the version of the component that is used during runtime.
Important: Game components must not inherit from EditorComponentBase. To create one or more game components to represent your editor component in runtime, use BuildGameEntity().
To learn more about editor components, see the Editor Components documentation.
AzToolsFramework::Components::EditorComponentBase::EditorComponentBase | ( | ) |
Creates an instance of this class.
|
overridevirtual |
Gets the transform component and selection component of the entity that the component belongs to, if the entity has them. Overrides AZ::Component::Activate().
Important: Components derived from EditorComponentBase must call the Activate() function of the base class.
Reimplemented in AzToolsFramework::Components::EditorComponentAdapter< TController, TRuntimeComponent, TConfiguration >, AzToolsFramework::Layers::EditorLayerComponent, AzToolsFramework::Components::EditorNonUniformScaleComponent, AzToolsFramework::Components::GenericComponentWrapper, AzToolsFramework::Components::ScriptEditorComponent, and AzToolsFramework::Components::TransformComponent.
|
inlinevirtual |
Implement this to add component specific context menu options to your editor component when right clicked in the entity inspector
AzToolsFramework::Components::EditorComponentBase::AZ_RTTI | ( | EditorComponentBase | , |
"{D5346BD4-7F20-444E-B370-327ACD03D4A0}" | , | ||
AZ::Component | |||
) |
Adds run-time type information to the component.
|
inlinevirtual |
Override this function to create one or more game components to represent your editor component in runtime.
Important: If your entity has a game component, you must implement this function.
This function is called by the slice builder. Any game components that you create should be attached to the game entity that is provided to this function. If you do not need to create a game component, you do not need to override this function. The provided component to the gameEntity is dynamically generated and owned by the gameEntity and should be deallocated appropriately.
gameEntity | A pointer to the game entity. |
Reimplemented in AzToolsFramework::Components::EditorComponentAdapter< TController, TRuntimeComponent, TConfiguration >, AzToolsFramework::Components::GenericComponentWrapper, AzToolsFramework::Components::ScriptEditorComponent, and AzToolsFramework::Components::TransformComponent.
|
overridevirtual |
Sets the component's pointers to the transform component and selection component to null. Overrides AZ::Component::Deactivate().
Important: Components derived from EditorComponentBase must call the Deactivate() function of the base class.
Reimplemented in AzToolsFramework::Components::EditorComponentAdapter< TController, TRuntimeComponent, TConfiguration >, AzToolsFramework::Layers::EditorLayerComponent, AzToolsFramework::Components::EditorNonUniformScaleComponent, AzToolsFramework::Components::GenericComponentWrapper, AzToolsFramework::Components::ScriptEditorComponent, and AzToolsFramework::Components::TransformComponent.
AZ::Transform AzToolsFramework::Components::EditorComponentBase::GetLocalTM | ( | ) | const |
Gets the local transform of the entity that the component belongs to, if the entity has a transform component. An entity's local transform is the entity's position relative to its parent entity.
|
finaloverride |
Gets the serialzied identifier of this component within an entity.
AZ::TransformInterface * AzToolsFramework::Components::EditorComponentBase::GetTransform | ( | ) | const |
Gets the transform interface of the entity that the component belongs to, if the entity has a transform component. A transform positions, rotates, and scales an entity in 3D space.
AZ::Transform AzToolsFramework::Components::EditorComponentBase::GetWorldTM | ( | ) | const |
Gets the world transform of the entity that the component belongs to, if the entity has a transform component. An entity's world transform is the entity's position within the entire game space.
|
overridevirtual |
Initializes the component's resources. Overrides AZ::Component::Init().
Important: Components derived from EditorComponentBase must call the Init() function of the base class.
(Optional) You can override this function to initialize resources that the component needs.
Reimplemented in AzToolsFramework::Components::EditorComponentAdapter< TController, TRuntimeComponent, TConfiguration >, AzToolsFramework::Layers::EditorLayerComponent, AzToolsFramework::Components::GenericComponentWrapper, AzToolsFramework::Components::ScriptEditorComponent, and AzToolsFramework::Components::TransformComponent.
bool AzToolsFramework::Components::EditorComponentBase::IsSelected | ( | ) | const |
Identifies whether the component is selected in the editor.
|
finaloverride |
Function to call after setting the entity in this component. For an editor component, this would set up the serialized identifier.
|
static |
Reflects component data into a variety of contexts (script, serialize, edit, and so on).
context | A pointer to the reflection context. |
void AzToolsFramework::Components::EditorComponentBase::SetDirty | ( | ) |
Sets a flag on the entire entity to indicate that the entity's properties were modified. Call this function whenever you alter an entity in an unexpected manner. For example, edits that you make to one entity might affect other entities, so the affected entities need to know that something changed. You do not need to call this function when editing an entity's property in the Property Editor, because that scenario automatically sets the flag. You need to call this function only when your entity's properties are modified outside the Property Editor, such as when a script loops over all lights and alters their radii.
|
inlinevirtual |
Implement this function to support dragging and dropping an asset onto this component.
assetId | A reference to the ID of the asset to drag and drop. |
Reimplemented in AzToolsFramework::Components::ScriptEditorComponent, and AzToolsFramework::Components::GenericComponentWrapper.
|
finaloverride |
Sets the provided string as the serialized identifier for the component.
serializedIdentifer | The unique identifier for this component within the entity it lives in. |