Open 3D Engine AzFramework 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.
AzFramework::RootSpawnableDefinition Class Referenceabstract

#include <RootSpawnableInterface.h>

Public Types

using OnRootSpawnableReadyEvent = AZ::Event< const AZ::Data::Asset< Spawnable > &, bool >
 

Public Member Functions

 AZ_RTTI (AzFramework::RootSpawnableDefinition, "{6F3698F4-005D-4F26-BE99-5DC2E21FAD38}")
 
virtual uint64_t AssignRootSpawnable (AZ::Data::Asset< Spawnable > rootSpawnable)=0
 
virtual void ReleaseRootSpawnable ()=0
 
virtual void ProcessSpawnableQueue ()=0
 
virtual void ProcessSpawnableQueueUntilEmpty ()=0
 

Detailed Description

Interface to manage the root spawnable. All calls to this interface need to be made from the main thread and all events are called from the main thread.

Member Function Documentation

◆ AssignRootSpawnable()

virtual uint64_t AzFramework::RootSpawnableDefinition::AssignRootSpawnable ( AZ::Data::Asset< Spawnable rootSpawnable)
pure virtual

Sets the provided spawnable as the new root spawnable. If a root spawnable has already been assigned this will unload any entities spawned from it and replace it. The provided spawnable will become the new root and all entities in it will be instanced into the game entity context.

Returns
the generation of the root spawnable that has been assigned.

◆ ProcessSpawnableQueue()

virtual void AzFramework::RootSpawnableDefinition::ProcessSpawnableQueue ( )
pure virtual

Force processing all SpawnableEntitiesManager requests immediately This is useful when loading a different level while SpawnableEntitiesManager still has pending requests

◆ ProcessSpawnableQueueUntilEmpty()

virtual void AzFramework::RootSpawnableDefinition::ProcessSpawnableQueueUntilEmpty ( )
pure virtual

Force processing all SpawnableEntitiesManager requests immediately and keep reprocessing until the queue is empty This is useful when unloading and shutting down to ensure that all pending requests are cleared.

◆ ReleaseRootSpawnable()

virtual void AzFramework::RootSpawnableDefinition::ReleaseRootSpawnable ( )
pure virtual

Releases the root spawnable if one is set, resulting in all entities spawned from it to be deleted and the spawnable asset to be released. This call is automatically done when AssignRootSpawnable is called while a root spawnable is assigned.


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