Skip to content

Struct Engine::PrefabSpawner

ClassList > Engine > PrefabSpawner

Runtime prefab instantiation hook. More...

  • #include <PrefabSpawner.hpp>

Public Attributes

Type Name
std::function< Entity(Registry &, const std::string &)> Spawn
Spawns every entity in the prefab and returns its root, or ( Entity )-1.

Detailed Description

The Engine module cannot depend on the Serialization module (Serialization already depends on Engine), so prefab loading is installed here as a callback. Serialization::SceneSerializer registers the implementation when it deserializes a scene, which means every editor-generated game gets runtime prefab spawning for free.

Engine systems (notably ReplicationSystem) call Spawn() when they need to instantiate a prefab during play.

Public Attributes Documentation

variable Spawn

Spawns every entity in the prefab and returns its root, or ( Entity )-1.

std::function<Entity(Registry&, const std::string&)> Engine::PrefabSpawner::Spawn;



The documentation for this class was generated from the following file /home/runner/work/r-type/r-type/Engine/include/Resources/PrefabSpawner.hpp