diff --git a/docs-preview/pr-913/dir_b6daa990b896c2c0c53126427e4d978d.html b/docs-preview/pr-913/dir_b6daa990b896c2c0c53126427e4d978d.html
index 1ffae93f8..921ff2dd2 100644
--- a/docs-preview/pr-913/dir_b6daa990b896c2c0c53126427e4d978d.html
+++ b/docs-preview/pr-913/dir_b6daa990b896c2c0c53126427e4d978d.html
@@ -85,6 +85,8 @@
- Class cubos::core::ecs::CommandBuffer.
- file cubos.hpp
- Class cubos::engine::Cubos.
+ - file name.hpp
+ - Class cubos::core::ecs::Name.
- file reflection.hpp
- Class cubos::core::ecs::TypeBuilder.
- file types.hpp
diff --git a/docs-preview/pr-913/examples-engine-scene.html b/docs-preview/pr-913/examples-engine-scene.html
index 298b0132e..a224493e1 100644
--- a/docs-preview/pr-913/examples-engine-scene.html
+++ b/docs-preview/pr-913/examples-engine-scene.html
@@ -83,7 +83,7 @@
"sub1": "cd007ba2-ee0d-44fd-bf36-85c829dbe66f",
"sub2": "cd007ba2-ee0d-44fd-bf36-85c829dbe66f"
}
-}
This file imports the asset with id cd007ba2-ee0d-44fd-bf36-85c829dbe66f
, which is the scene we looked at in the previous file, under the name sub1
. It then imports the very same scene again, but this time with the name sub2
instead. This effectively instantiates the entities of the previous scene twice in this new scene, each with their names prefixed with either sub1.
or sub2.
Also take a look at the DistanceTo
relation: it is a symmetric relation, so it doesn't make a different whether wwe put it in sub.root
or sub2.root
. Since DistanceTo
is a relation which holds data, instead of only specifying the target, as we do with OwnedBy
, we write a JSON object with a key, "value"
.
Under entities
, we can override the entities in the sub-scenes to edit components or add new ones. For example, by referencing sub1.root
we are making local changes to the root
entity of that instance of the subscene. The result of the changes we make to both sub1.root
and sub2.root
is that the owner of these entities will be set to be the main
entity.
Now that we have our scene file, let's get our application to load it. The first thing we're going to need is a reference to the scene asset. For the purposes of this sample we can simply use an hardcoded reference to the asset.
static const Asset<Scene> SceneAsset = AnyAsset("f0d86ba8-5f34-440f-a180-d9d12c8e8b91");
Then we'll need a system that spawns that scene. To do this we simply get the Scene object from the asset, and then spawn its entities. Commands::spawn will create in the world a copy of every entity defined in the scene's blueprint. It won't remove the entities already there, so if you want to close a scene, you'll have to do it yourself.
cubos.startupSystem("spawn the scene")
+}
This file imports the asset with id cd007ba2-ee0d-44fd-bf36-85c829dbe66f
, which is the scene we looked at in the previous file, under the name sub1
. It then imports the very same scene again, but this time with the name sub2
instead. This effectively instantiates the entities of the previous scene twice in this new scene, each with their names prefixed with either sub1.
or sub2.
Also take a look at the DistanceTo
relation: it is a symmetric relation, so it doesn't make a different whether wwe put it in sub.root
or sub2.root
. Since DistanceTo
is a relation which holds data, instead of only specifying the target, as we do with OwnedBy
, we write a JSON object with a key, "value"
.
Under entities
, we can override the entities in the sub-scenes to edit components or add new ones. For example, by referencing sub1.root
we are making local changes to the root
entity of that instance of the subscene. The result of the changes we make to both sub1.root
and sub2.root
is that the owner of these entities will be set to be the main
entity.
Now that we have our scene file, let's get our application to load it. The first thing we're going to need is a reference to the scene asset. For the purposes of this sample we can simply use an hardcoded reference to the asset.
static const Asset<Scene> SceneAsset = AnyAsset("f0d86ba8-5f34-440f-a180-d9d12c8e8b91");
Then we'll need a system that spawns that scene. To do this we simply get the Scene object from the asset, and then spawn its entities. Commands::spawn will create in the world a copy of every entity defined in the scene's blueprint. It won't remove the entities already there, so if you want to close a scene, you'll have to do it yourself.
cubos.startupSystem("spawn the scene")
.tagged("spawn")
.tagged("cubos.assets")
.call([](Commands commands, const Assets& assets) {
diff --git a/docs-preview/pr-913/files.html b/docs-preview/pr-913/files.html
index 49fd5b691..d3b91178d 100644
--- a/docs-preview/pr-913/files.html
+++ b/docs-preview/pr-913/files.html
@@ -160,6 +160,7 @@ Files