Open 3D Engine AzToolsFramework API Reference 23.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
AzToolsFramework::PrefabEditorEntityOwnershipInterface Class Referenceabstract

Inherited by AzToolsFramework::PrefabEditorEntityOwnershipService [private].

Public Member Functions

 AZ_RTTI (PrefabEditorEntityOwnershipInterface, "{38E764BA-A089-49F3-848F-46018822CE2E}")
 
virtual bool IsRootPrefabAssigned () const =0
 
virtual Prefab::InstanceOptionalReference GetRootPrefabInstance ()=0
 Returns an optional reference to the root prefab instance.
 
virtual Prefab::TemplateId GetRootPrefabTemplateId ()=0
 Returns the template id for the root prefab instance.
 
virtual void CreateNewLevelPrefab (AZStd::string_view filename, const AZStd::string &templateFilename)=0
 
virtual Prefab::InstanceOptionalReference CreatePrefab (const AZStd::vector< AZ::Entity * > &entities, AZStd::vector< AZStd::unique_ptr< Prefab::Instance > > &&nestedPrefabInstances, AZ::IO::PathView filePath, Prefab::InstanceOptionalReference instanceToParentUnder=AZStd::nullopt)=0
 
virtual Prefab::InstanceOptionalReference InstantiatePrefab (AZ::IO::PathView filePath, Prefab::InstanceOptionalReference instanceToParentUnder=AZStd::nullopt)=0
 
virtual void StartPlayInEditor ()=0
 
virtual void StopPlayInEditor ()=0
 
virtual const AzFramework::InMemorySpawnableAssetContainer::SpawnableAssets & GetPlayInEditorAssetData () const =0
 
virtual bool LoadFromStream (AZ::IO::GenericStream &stream, AZStd::string_view filename)=0
 
virtual bool SaveToStream (AZ::IO::GenericStream &stream, AZStd::string_view filename)=0
 
virtual Prefab::InstanceOptionalReference GetInstanceReferenceFromRootAliasPath (Prefab::RootAliasPath rootAliasPath) const =0
 
virtual bool GetInstancesInRootAliasPath (Prefab::RootAliasPath rootAliasPath, const AZStd::function< bool(const Prefab::InstanceOptionalReference)> &callback) const =0
 
virtual void RegisterGameModeEventHandler (AZ::Event< GameModeState >::Handler &handler)=0
 

Member Function Documentation

◆ CreatePrefab()

virtual Prefab::InstanceOptionalReference AzToolsFramework::PrefabEditorEntityOwnershipInterface::CreatePrefab ( const AZStd::vector< AZ::Entity * > &  entities,
AZStd::vector< AZStd::unique_ptr< Prefab::Instance > > &&  nestedPrefabInstances,
AZ::IO::PathView  filePath,
Prefab::InstanceOptionalReference  instanceToParentUnder = AZStd::nullopt 
)
pure virtual

Creates a prefab instance with the provided entities and nestedPrefabInstances.

Parameters
entitiesThe entities to put under the new prefab.
nestedPrefabInstancesThe nested prefab instances to put under the new prefab.
filePathThe filepath corresponding to the prefab file to be created.
instanceToParentUnderThe instance the newly created prefab instance is parented under.
Returns
The optional reference to the prefab created.

◆ GetInstanceReferenceFromRootAliasPath()

virtual Prefab::InstanceOptionalReference AzToolsFramework::PrefabEditorEntityOwnershipInterface::GetInstanceReferenceFromRootAliasPath ( Prefab::RootAliasPath  rootAliasPath) const
pure virtual

Returns the reference to the instance corresponding to the RootAliasPath provided.

Parameters
rootAliasPathThe RootAliasPath to be queried.
Returns
A reference to the instance if valid, AZStd::nullopt otherwise.

Implemented in AzToolsFramework::PrefabEditorEntityOwnershipService.

◆ GetInstancesInRootAliasPath()

virtual bool AzToolsFramework::PrefabEditorEntityOwnershipInterface::GetInstancesInRootAliasPath ( Prefab::RootAliasPath  rootAliasPath,
const AZStd::function< bool(const Prefab::InstanceOptionalReference)> &  callback 
) const
pure virtual

Allows to iterate through all instances referenced in the path, from the root down.

Parameters
rootAliasPathThe RootAliasPath to iterate through. If invalid, callback will not be called.
callbackThe function to call on each instance. If it returns true, it prevents the rest of the path from being called.
Returns
True if the iteration was halted by a callback returning true, false otherwise. Also returns false if the path is invalid.

Implemented in AzToolsFramework::PrefabEditorEntityOwnershipService.

◆ GetPlayInEditorAssetData()

virtual const AzFramework::InMemorySpawnableAssetContainer::SpawnableAssets & AzToolsFramework::PrefabEditorEntityOwnershipInterface::GetPlayInEditorAssetData ( ) const
pure virtual

Get all Assets generated by Prefab processing when entering Play-In Editor mode (Ctrl+G)

Returns
The vector of Assets generated by Prefab processing

◆ InstantiatePrefab()

virtual Prefab::InstanceOptionalReference AzToolsFramework::PrefabEditorEntityOwnershipInterface::InstantiatePrefab ( AZ::IO::PathView  filePath,
Prefab::InstanceOptionalReference  instanceToParentUnder = AZStd::nullopt 
)
pure virtual

Instantiate the prefab file provided.

Parameters
filePathThe filepath for the prefab file the instance should be created from.
instanceToParentUnderThe instance the newly instantiated prefab instance is parented under.
Returns
The optional reference to the prefab instance.

◆ IsRootPrefabAssigned()

virtual bool AzToolsFramework::PrefabEditorEntityOwnershipInterface::IsRootPrefabAssigned ( ) const
pure virtual

Returns whether the system has a root instance assigned.

Returns
True if a root prefab is assigned, false otherwise.

Implemented in AzToolsFramework::PrefabEditorEntityOwnershipService.


The documentation for this class was generated from the following file: