Switching SceneItems to smarts
This commit is contained in:
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
|
Reference in New Issue
Block a user