R-Type
R-Type project
KapEngine::Prefabs::PrefabManager Class Reference

Public Member Functions

 PrefabManager (KEngine &engine)
 
void createPrefab (std::string const &name, const Prefab &hander)
 Create a prefab. More...
 
bool instantiatePrefab (std::string const &name, SceneManagement::Scene &scene, std::shared_ptr< GameObject > &gameObject)
 Instantiate a prefab. More...
 
bool instantiatePrefab (std::string const &name, std::size_t const &sceneId, std::shared_ptr< GameObject > &gameObject)
 Instantiate a prefab. More...
 
void removePrefab (std::string const &name)
 Destroy a prefab. More...
 

Member Function Documentation

◆ createPrefab()

void PrefabManager::createPrefab ( std::string const &  name,
const Prefab &  hander 
)

Create a prefab.

Parameters
nameThe name of the prefab
handerThe handler of the prefab (the function that will be called when the prefab is instantiated)

◆ instantiatePrefab() [1/2]

bool PrefabManager::instantiatePrefab ( std::string const &  name,
SceneManagement::Scene scene,
std::shared_ptr< GameObject > &  gameObject 
)

Instantiate a prefab.

Parameters
nameThe name of the prefab
sceneThe scene where the prefab will be instantiated
gameObjectThe game object that will be instantiated

◆ instantiatePrefab() [2/2]

bool PrefabManager::instantiatePrefab ( std::string const &  name,
std::size_t const &  sceneId,
std::shared_ptr< GameObject > &  gameObject 
)

Instantiate a prefab.

Parameters
nameThe name of the prefab
sceneIdThe id of the scene where the prefab will be instantiated
gameObjectThe game object that will be instantiated
componentsThe components that will be added to the game object

◆ removePrefab()

void PrefabManager::removePrefab ( std::string const &  name)

Destroy a prefab.

Parameters
nameThe name of the prefab

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