Switching SceneItems to smarts

This commit is contained in:
2023-11-12 23:02:11 -06:00
parent e540efb726
commit ba185e9fe4
124 changed files with 185 additions and 775 deletions

View File

@ -30,7 +30,7 @@ namespace Dawn {
* @param context Custom context that this prefab needs to initialize.
* @return The instance of the created prefab.
*/
static O * create(J *context) {
static std::shared_ptr<O> create(J *context) {
assertNotNull(context, "Prefab::create: Context cannot be null");
return P::prefabCreate(context);
}

View File

@ -20,8 +20,8 @@ namespace Dawn {
* @param scene Scene that this prefab is going to be added to.
* @return The created prefab instance.
*/
static O * prefabCreate(Scene *scene) {
O *item = scene->createSceneItemOfType<O>();
static std::shared_ptr<O> prefabCreate(Scene *scene) {
std::shared_ptr<O> item = scene->createSceneItemOfType<O>();
auto game = scene->game.lock();
assertNotNull(game, "Game cannot be null!");
item->prefabInit(&game->assetManager);