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::Scripts::SpawnableScriptMediator Class Referencefinal

#include <SpawnableScriptMediator.h>

Inherits AZ::TickBus::Handler.

Public Member Functions

 AZ_TYPE_INFO (AzFramework::Scripts::SpawnableScriptMediator, "{9C3118FE-2E78-49BE-BE7A-B41F95B3FCF8}")
 
void OnTick (float deltaTime, AZ::ScriptTimePoint time) override
 
EntitySpawnTicket CreateSpawnTicket (const SpawnableScriptAssetRef &spawnableAsset)
 Creates EntitySpawnTicket using provided prefab asset.
 
bool Spawn (EntitySpawnTicket spawnTicket)
 Spawns a prefab and places it under level entity.
 
bool SpawnAndParent (EntitySpawnTicket spawnTicket, const AZ::EntityId &parentId)
 Spawns a prefab and places it under parentId entity.
 
bool SpawnAndParentAndTransform (EntitySpawnTicket spawnTicket, const AZ::EntityId &parentId, const AZ::Vector3 &translation, const AZ::Vector3 &rotation, float scale)
 
bool Despawn (EntitySpawnTicket spawnTicket)
 Despawns a prefab.
 
void Clear ()
 Clears delayed spawn or despawn callbacks.
 

Static Public Member Functions

static void Reflect (AZ::ReflectContext *context)
 

Static Public Attributes

static constexpr const char * RootSpawnableRegistryKey = "/Amazon/AzCore/Bootstrap/RootSpawnable"
 

Detailed Description

A helper class for direct calls to SpawnableEntitiesInterface that is reflected with BehaviorContext for interfacing with Lua API

Member Function Documentation

◆ SpawnAndParentAndTransform()

bool AzFramework::Scripts::SpawnableScriptMediator::SpawnAndParentAndTransform ( EntitySpawnTicket  spawnTicket,
const AZ::EntityId &  parentId,
const AZ::Vector3 &  translation,
const AZ::Vector3 &  rotation,
float  scale 
)

Spawns a prefab and places it relative to provided parent, if no parentId is specified then places it in world coordinates


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