#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" |
A helper class for direct calls to SpawnableEntitiesInterface that is reflected with BehaviorContext for interfacing with Lua API
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