Browse Source

Added cloning tutorial

Jorn Theunissen 6 years ago
parent
commit
fe8460a9af

+ 1 - 1
Tutorials/Tutorials/Assets/GameSettings.xkgamesettings

@@ -2,7 +2,7 @@
 Id: 66354f1a-ad5a-4504-b892-293a74e9a496
 SerializedVersion: {Xenko: 3.1.0.1}
 Tags: []
-DefaultScene: 9e1b53ff-dc0c-410a-8972-14f949f83a01:Scenes/Basics/Getting a component
+DefaultScene: 52a557d6-1f2c-4983-a0bb-2c12d562d3bf:Scenes/Basics/Cloning entities
 GraphicsCompositor: 6fbf9e7f-5a64-4144-9f7e-42ab89526670:GraphicsCompositor
 Defaults:
     - !Xenko.Audio.AudioEngineSettings,Xenko.Audio

+ 102 - 0
Tutorials/Tutorials/Assets/Scenes/Basics/ChildEntities.xkscene

@@ -0,0 +1,102 @@
+!SceneAsset
+Id: ba8ed57d-74b9-4121-baf0-6a92463b600a
+SerializedVersion: {Xenko: 3.1.0.1}
+Tags: []
+ChildrenIds: []
+Offset: {X: 0.0, Y: 0.0, Z: 0.0}
+Hierarchy:
+    RootParts:
+        - ref!! 61b4fab8-dcaa-4fca-b6bc-3c22885bbd15
+        - ref!! 0384dbde-4ce0-4303-8a88-392565c3b1e7
+        - ref!! 9ad6111c-5ccd-43a6-9673-ecf51bf7fb83
+        - ref!! b966ca42-ec4d-4e3e-8521-eb46e9d79b01
+    Parts:
+        -   Entity:
+                Id: 0384dbde-4ce0-4303-8a88-392565c3b1e7
+                Name: Directional light
+                Components:
+                    cf26351dfd6822268d36b77072bcc655: !TransformComponent
+                        Id: 8f6a8c0b-fcc0-42fe-bb21-b8c963a671ce
+                        Position: {X: 100.0, Y: 0.0, Z: 0.0}
+                        Rotation: {X: 1.131334E-08, Y: 0.9659258, Z: 0.258819044, W: -4.222196E-08}
+                        Scale: {X: 1.0, Y: 1.0, Z: 1.0}
+                        Children: {}
+                    e3f271d9c2060484c44e8dfef59ed0e3: !LightComponent
+                        Id: 8f429981-ee5d-4fdb-b6cf-5bc2ec86ff6b
+                        Type: !LightDirectional
+                            Color: !ColorRgbProvider
+                                Value: {R: 1.0, G: 1.0, B: 1.0}
+                            Shadow:
+                                Enabled: true
+                                Filter: !LightShadowMapFilterTypePcf
+                                    FilterSize: Filter5x5
+                                Size: Large
+                                DepthRange: {}
+                                PartitionMode: !LightDirectionalShadowMap.PartitionLogarithmic {}
+                                ComputeTransmittance: false
+                                BiasParameters: {}
+                        Intensity: 20.0
+        -   Entity:
+                Id: 61b4fab8-dcaa-4fca-b6bc-3c22885bbd15
+                Name: Camera
+                Components:
+                    d5dd94550dc377d8b1703c74aae2cee5: !TransformComponent
+                        Id: fc51bc89-fea6-4364-8ea8-7a5cbd129c26
+                        Position: {X: 0.0, Y: 2.0, Z: -4.0}
+                        Rotation: {X: 5.70548142E-09, Y: 0.9914449, Z: 0.1305262, W: -4.33374332E-08}
+                        Scale: {X: 1.0, Y: 1.0, Z: 1.0}
+                        Children: {}
+                    f1cc2f84c67fbd3cc50a22dd0ef605a5: !CameraComponent
+                        Id: a4863eb1-9536-452b-b2c6-8245176de4fe
+                        Name: null
+                        Projection: Perspective
+                        Slot: c9cb3666-f711-498c-9878-292e79ed7993
+        -   Entity:
+                Id: 9ad6111c-5ccd-43a6-9673-ecf51bf7fb83
+                Name: Skybox light
+                Components:
+                    88b62d474d21080cf1a760192a108619: !TransformComponent
+                        Id: 11d180c6-cef2-4708-b87d-b610ce00c78e
+                        Position: {X: 100.0, Y: 0.0, Z: 0.0}
+                        Rotation: {X: 0.0, Y: 0.0, Z: 0.0, W: 1.0}
+                        Scale: {X: 1.0, Y: 1.0, Z: 1.0}
+                        Children: {}
+                    b6410438b41b6be62428102415f68a4e: !LightComponent
+                        Id: c7b7f037-0efe-4e90-82df-5e6e0ce942d8
+                        Type: !LightSkybox
+                            Skybox: ae4fd991-6290-4c24-b73b-25d81a1a4837:Materials/Skybox
+                    073131bbebf95a3cbbe2d431328d38b1: !BackgroundComponent
+                        Id: c655aa84-0bb8-4c4c-8af2-e445882907c8
+                        Texture: b7f73672-f9bf-44ae-8a04-0017010b4ca1:Materials/Skybox texture
+        -   Entity:
+                Id: b966ca42-ec4d-4e3e-8521-eb46e9d79b01
+                Name: Theapot-Parent
+                Components:
+                    f8eee6f467c9263f9fdd120f5463f988: !TransformComponent
+                        Id: cc767825-0a39-4a11-bba1-c045b6bb0bc0
+                        Position: {X: 0.0, Y: 0.0, Z: 0.0}
+                        Rotation: {X: 0.0, Y: 0.0, Z: 0.0, W: 1.0}
+                        Scale: {X: 1.0, Y: 1.0, Z: 1.0}
+                        Children: {}
+                    3633cb40f574236299aec88b18c090d2: !ModelComponent
+                        Id: e3607a8d-6c36-4850-b68b-79c45bb9fa49
+                        Model: 9a3a7dbc-7b08-478a-aab2-19afe1d6ce1c:Models/Teapot
+                        Materials: {}
+                    c8e9503a549427f69146c243e118f2d0: !Tutorials.Basics.BasicsProperties,Tutorials
+                        Id: a716eff4-687e-4e6e-b3cd-3f4a0d54241f
+                        aBoolean: true
+                        aFloat: 5.6
+                        anInteger: 10
+                        aString: Hello world
+                        aColor: {R: 255, G: 0, B: 0, A: 255}
+                        aVector2: {X: 1.0, Y: 2.0}
+                        aVector3: {X: 1.0, Y: 2.0, Z: 3.0}
+                        aVector4: {X: 1.0, Y: 2.0, Z: 3.0, W: 4.0}
+                        entity: ref!! 0384dbde-4ce0-4303-8a88-392565c3b1e7
+                        stringList:
+                            e682013809525a86d639b94ecd333772: 'How '
+                            5139d0d0b839acde1e5a77e09474a206: Are
+                            8f11ec25088e52035781da4c298965ff: You
+                        entityList:
+                            b34837d03806d2517ca24a0d0e2743e1: ref!! 0384dbde-4ce0-4303-8a88-392565c3b1e7
+                            790bcdf3522fd20ebc41811533aa6fab: ref!! 9ad6111c-5ccd-43a6-9673-ecf51bf7fb83

+ 103 - 0
Tutorials/Tutorials/Assets/Scenes/Basics/Cloning entities.xkscene

@@ -0,0 +1,103 @@
+!SceneAsset
+Id: 52a557d6-1f2c-4983-a0bb-2c12d562d3bf
+SerializedVersion: {Xenko: 3.1.0.1}
+Tags: []
+ChildrenIds: []
+Offset: {X: 0.0, Y: 0.0, Z: 0.0}
+Hierarchy:
+    RootParts:
+        - ref!! 355518a5-d044-4304-806f-3f3a9233ce4e
+        - ref!! 2c83a168-e16d-4a8f-af6d-76533fbc32d2
+        - ref!! ca9d7b91-dd19-4a65-93f6-2b76f4294916
+        - ref!! 23f2b5eb-4d46-436a-96a0-e3f317963ee3
+        - ref!! c9a27485-6854-4adf-92d0-9659ffb49805
+    Parts:
+        -   Entity:
+                Id: 23f2b5eb-4d46-436a-96a0-e3f317963ee3
+                Name: Entity to clone
+                Components:
+                    f8eee6f467c9263f9fdd120f5463f988: !TransformComponent
+                        Id: 14403fe2-6206-4758-bc1e-65938eca92b3
+                        Position: {X: 0.0, Y: 1.0, Z: 0.0}
+                        Rotation: {X: 0.0, Y: 0.0, Z: 0.0, W: 1.0}
+                        Scale: {X: 1.0, Y: 1.0, Z: 1.0}
+                        Children: {}
+                    3633cb40f574236299aec88b18c090d2: !ModelComponent
+                        Id: ed362fc4-8096-4428-b4b2-0fbc47469c69
+                        Model: 9a3a7dbc-7b08-478a-aab2-19afe1d6ce1c:Models/Teapot
+                        Materials:
+                            e1d8cfb93adefdffb6faa2cc9c0926bd~0: 619de649-4998-4996-bd74-085eaffdbbeb:Materials/Yellow
+        -   Entity:
+                Id: 2c83a168-e16d-4a8f-af6d-76533fbc32d2
+                Name: Directional light
+                Components:
+                    cf26351dfd6822268d36b77072bcc655: !TransformComponent
+                        Id: cce5f44c-ff22-4230-b410-c9bf9f611f22
+                        Position: {X: 100.0, Y: 0.0, Z: 0.0}
+                        Rotation: {X: 1.131334E-08, Y: 0.9659258, Z: 0.258819044, W: -4.222196E-08}
+                        Scale: {X: 1.0, Y: 1.0, Z: 1.0}
+                        Children: {}
+                    e3f271d9c2060484c44e8dfef59ed0e3: !LightComponent
+                        Id: 76e6e836-2849-46e6-bad4-c1392d4fb15f
+                        Type: !LightDirectional
+                            Color: !ColorRgbProvider
+                                Value: {R: 1.0, G: 1.0, B: 1.0}
+                            Shadow:
+                                Enabled: true
+                                Filter: !LightShadowMapFilterTypePcf
+                                    FilterSize: Filter5x5
+                                Size: Large
+                                DepthRange: {}
+                                PartitionMode: !LightDirectionalShadowMap.PartitionLogarithmic {}
+                                ComputeTransmittance: false
+                                BiasParameters: {}
+                        Intensity: 20.0
+        -   Entity:
+                Id: 355518a5-d044-4304-806f-3f3a9233ce4e
+                Name: Camera
+                Components:
+                    d5dd94550dc377d8b1703c74aae2cee5: !TransformComponent
+                        Id: d4916491-a028-4324-b557-2a3b44e2268e
+                        Position: {X: -0.168541268, Y: 1.97455645, Z: -6.0}
+                        Rotation: {X: -7.915897E-09, Y: -0.9848077, Z: -0.173648179, W: 7.343504E-08}
+                        Scale: {X: 1.0, Y: 1.0, Z: 1.0}
+                        Children: {}
+                    f1cc2f84c67fbd3cc50a22dd0ef605a5: !CameraComponent
+                        Id: 8339e39d-5a13-441a-b701-f5717bafa674
+                        Name: null
+                        Projection: Perspective
+                        Slot: c9cb3666-f711-498c-9878-292e79ed7993
+        -   Entity:
+                Id: c9a27485-6854-4adf-92d0-9659ffb49805
+                Name: Theapot1
+                Components:
+                    f8eee6f467c9263f9fdd120f5463f988: !TransformComponent
+                        Id: 13dc12f0-e2ca-4072-b389-baccbb3c66a4
+                        Position: {X: 0.0, Y: -2.0, Z: 0.0}
+                        Rotation: {X: 0.0, Y: 0.0, Z: 0.0, W: 1.0}
+                        Scale: {X: 1.0, Y: 1.0, Z: 1.0}
+                        Children: {}
+                    3633cb40f574236299aec88b18c090d2: !ModelComponent
+                        Id: 331cd9e3-dfda-439c-a617-0bb891bd29af
+                        Model: 9a3a7dbc-7b08-478a-aab2-19afe1d6ce1c:Models/Teapot
+                        Materials: {}
+                    a96ae365f5927b1855f63f18d3009d47: !Tutorials.Basics.CloneEntity,Tutorials
+                        Id: c78f41d3-6d82-4e57-b6af-7a350bccae13
+                        entityToClone: ref!! 23f2b5eb-4d46-436a-96a0-e3f317963ee3
+        -   Entity:
+                Id: ca9d7b91-dd19-4a65-93f6-2b76f4294916
+                Name: Skybox light
+                Components:
+                    88b62d474d21080cf1a760192a108619: !TransformComponent
+                        Id: 059775d1-75e4-4777-a1f0-0360a267bccd
+                        Position: {X: 100.0, Y: 0.0, Z: 0.0}
+                        Rotation: {X: 0.0, Y: 0.0, Z: 0.0, W: 1.0}
+                        Scale: {X: 1.0, Y: 1.0, Z: 1.0}
+                        Children: {}
+                    b6410438b41b6be62428102415f68a4e: !LightComponent
+                        Id: a97fd557-867f-4ef8-aa23-876218c82afb
+                        Type: !LightSkybox
+                            Skybox: ae4fd991-6290-4c24-b73b-25d81a1a4837:Materials/Skybox
+                    073131bbebf95a3cbbe2d431328d38b1: !BackgroundComponent
+                        Id: a1e59be8-8ba8-473c-bd6b-a6a9bce8926d
+                        Texture: b7f73672-f9bf-44ae-8a04-0017010b4ca1:Materials/Skybox texture

+ 87 - 9
Tutorials/Tutorials/Assets/Scenes/Basics/Getting a component.xkscene

@@ -17,7 +17,7 @@ Hierarchy:
                 Components:
                     d5dd94550dc377d8b1703c74aae2cee5: !TransformComponent
                         Id: 609eeee4-edc1-402b-9f1f-4cc759ba8e0a
-                        Position: {X: 0.0, Y: 2.0, Z: -4.0}
+                        Position: {X: 0.0, Y: 2.71562958, Z: -7.16720963}
                         Rotation: {X: 5.70548142E-09, Y: 0.9914449, Z: 0.1305262, W: -4.33374332E-08}
                         Scale: {X: 1.0, Y: 1.0, Z: 1.0}
                         Children: {}
@@ -26,6 +26,54 @@ Hierarchy:
                         Name: null
                         Projection: Perspective
                         Slot: c9cb3666-f711-498c-9878-292e79ed7993
+        -   Entity:
+                Id: 55db34bf-75c8-44ce-8214-9d98b5f7a4dd
+                Name: Subchild1 of child 1
+                Components:
+                    f8eee6f467c9263f9fdd120f5463f988: !TransformComponent
+                        Id: 7cd0224b-0be4-4e3f-ab13-769c5a8dbc0b
+                        Position: {X: -1.0, Y: -2.0, Z: 0.0}
+                        Rotation: {X: 0.0, Y: 0.0, Z: 0.0, W: 1.0}
+                        Scale: {X: 1.0, Y: 1.0, Z: 1.0}
+                        Children: {}
+                    3633cb40f574236299aec88b18c090d2: !ModelComponent
+                        Id: 51fd9946-143d-48d4-bdd8-c41bba375db5
+                        Model: 9a3a7dbc-7b08-478a-aab2-19afe1d6ce1c:Models/Teapot
+                        Materials:
+                            dd7b292dea132447c896f651e0b0bc8c~0: ca5e832c-0dc0-42e8-bd85-fcb24bfd34f1:Materials/Green
+        -   Entity:
+                Id: 5e6211ae-959f-4c8b-9f39-e939b55bac21
+                Name: Child0
+                Components:
+                    f8eee6f467c9263f9fdd120f5463f988: !TransformComponent
+                        Id: bd3c62a9-d72d-4fcf-b32b-191e972c3172
+                        Position: {X: -1.0, Y: -1.0, Z: 0.0}
+                        Rotation: {X: 0.0, Y: 0.0, Z: 0.0, W: 1.0}
+                        Scale: {X: 1.0, Y: 1.0, Z: 1.0}
+                        Children: {}
+                    3633cb40f574236299aec88b18c090d2: !ModelComponent
+                        Id: 3447652b-9b91-4031-95b2-36dfccd0a233
+                        Model: 9a3a7dbc-7b08-478a-aab2-19afe1d6ce1c:Models/Teapot
+                        Materials:
+                            c0ce33837f830b3a2b3943378dfa3152~0: 619de649-4998-4996-bd74-085eaffdbbeb:Materials/Yellow
+        -   Entity:
+                Id: 736e896f-c76d-4d2e-97da-f5403c81ed83
+                Name: Child1
+                Components:
+                    f8eee6f467c9263f9fdd120f5463f988: !TransformComponent
+                        Id: a897133d-a1b8-4961-a13b-1c88a9dc130a
+                        Position: {X: -1.0, Y: -2.0, Z: 0.0}
+                        Rotation: {X: 0.0, Y: 0.0, Z: 0.0, W: 1.0}
+                        Scale: {X: 1.0, Y: 1.0, Z: 1.0}
+                        Children:
+                            b9257ecef22ee5d5f71291bc97c7f67c: ref!! 81fa7299-6356-47d3-924e-f3ce43bd5e44
+                            14af6c4d9f57fbe7dc7933f3c493716c: ref!! 7cd0224b-0be4-4e3f-ab13-769c5a8dbc0b
+                            044770e133b3d61abd221ccaceed593c: ref!! 4ef88c1b-7cef-4005-9d32-e539c3220d01
+                    3633cb40f574236299aec88b18c090d2: !ModelComponent
+                        Id: 85e9fed4-e04f-4a8b-9b8b-5d9d4e25c056
+                        Model: 9a3a7dbc-7b08-478a-aab2-19afe1d6ce1c:Models/Teapot
+                        Materials:
+                            247ee65b7c567fa41323ad3f52a29d73~0: 619de649-4998-4996-bd74-085eaffdbbeb:Materials/Yellow
         -   Entity:
                 Id: 771ec28a-d635-48af-a09e-58453dad09db
                 Name: Skybox light
@@ -45,23 +93,53 @@ Hierarchy:
                         Texture: b7f73672-f9bf-44ae-8a04-0017010b4ca1:Materials/Skybox texture
         -   Entity:
                 Id: a96ff7c1-f612-40be-b936-dba94f49f15b
-                Name: Theapot-Parent
+                Name: Parent
                 Components:
                     f8eee6f467c9263f9fdd120f5463f988: !TransformComponent
                         Id: e3afb164-c852-4cb1-84f5-aac2e3410512
-                        Position: {X: 0.0, Y: 0.0, Z: 0.0}
+                        Position: {X: 1.0, Y: 3.12821126, Z: 0.0}
                         Rotation: {X: 0.0, Y: 0.0, Z: 0.0, W: 1.0}
                         Scale: {X: 1.0, Y: 1.0, Z: 1.0}
-                        Children: {}
+                        Children:
+                            b9257ecef22ee5d5f71291bc97c7f67c: ref!! bd3c62a9-d72d-4fcf-b32b-191e972c3172
+                            f26fcdfbf5bf2b9bba008335e577ee67: ref!! a897133d-a1b8-4961-a13b-1c88a9dc130a
                     3633cb40f574236299aec88b18c090d2: !ModelComponent
                         Id: 60e9ce47-a7f9-4167-960e-6be77ab17fe0
                         Model: 9a3a7dbc-7b08-478a-aab2-19afe1d6ce1c:Models/Teapot
                         Materials: {}
-                    7a91bb5c959d23c5653c55584ba672a6: !Tutorials.Basics.AmmoComponent,Tutorials
-                        Id: a3e08204-700a-46ce-b884-49881cfd232b
-                        Clips: 0
-                    abd496ed6dd959fdf13a4f2245f2082b: !Tutorials.Basics.GettingAComponent,Tutorials
-                        Id: 28081f1e-a2e6-4d35-b524-41d6fe003119
+                    04b78b37519c1bdc636bd519738bddbc: !Tutorials.Basics.ChildEntities,Tutorials
+                        Id: 1415e205-e12b-4112-89b0-dcb2e1e335db
+        -   Entity:
+                Id: b9149b06-d557-48ea-be39-4d0ed9e95198
+                Name: Subchild2 of child 1
+                Components:
+                    f8eee6f467c9263f9fdd120f5463f988: !TransformComponent
+                        Id: 4ef88c1b-7cef-4005-9d32-e539c3220d01
+                        Position: {X: -1.0, Y: -3.0, Z: 0.0}
+                        Rotation: {X: 0.0, Y: 0.0, Z: 0.0, W: 1.0}
+                        Scale: {X: 1.0, Y: 1.0, Z: 1.0}
+                        Children: {}
+                    3633cb40f574236299aec88b18c090d2: !ModelComponent
+                        Id: 2662e4c3-0e24-47ec-82bd-86031c5d69fa
+                        Model: 9a3a7dbc-7b08-478a-aab2-19afe1d6ce1c:Models/Teapot
+                        Materials:
+                            dd7b292dea132447c896f651e0b0bc8c~0: ca5e832c-0dc0-42e8-bd85-fcb24bfd34f1:Materials/Green
+        -   Folder: null
+            Entity:
+                Id: cc17fd52-cedf-4d3b-9c2c-4fa242ce14c6
+                Name: Subchild0 of child 1
+                Components:
+                    f8eee6f467c9263f9fdd120f5463f988: !TransformComponent
+                        Id: 81fa7299-6356-47d3-924e-f3ce43bd5e44
+                        Position: {X: -1.0, Y: -1.0, Z: 0.0}
+                        Rotation: {X: 0.0, Y: 0.0, Z: 0.0, W: 1.0}
+                        Scale: {X: 1.0, Y: 1.0, Z: 1.0}
+                        Children: {}
+                    3633cb40f574236299aec88b18c090d2: !ModelComponent
+                        Id: d370e958-3b42-4ace-a903-51a5c77f9b6e
+                        Model: 9a3a7dbc-7b08-478a-aab2-19afe1d6ce1c:Models/Teapot
+                        Materials:
+                            dd7b292dea132447c896f651e0b0bc8c~0: ca5e832c-0dc0-42e8-bd85-fcb24bfd34f1:Materials/Green
         -   Entity:
                 Id: d4b27378-fcb3-4b3f-be94-c924e6724483
                 Name: Directional light

+ 5 - 0
Tutorials/Tutorials/Basics/BasicsProperties.cs

@@ -1,4 +1,5 @@
 using System.Collections.Generic;
+using Xenko.Core;
 using Xenko.Core.Mathematics;
 using Xenko.Engine;
 
@@ -25,6 +26,10 @@ namespace Tutorials.Basics {
         public List<string> stringList = new List<string>();
         public List<Entity> entityList = new List<Entity>();
 
+        //If we dont want a public property to be visible in the editor we can use '[DataMemberIgnore]'
+        [DataMemberIgnore]
+        public string aHiddenProperty = "HiddenInEditor";
+
         public override void Update() {
             DebugText.Print("Integer: " +           anInteger,          new Int2(30, 200));
             DebugText.Print("Float: " +             aFloat,             new Int2(30, 220));

+ 51 - 0
Tutorials/Tutorials/Basics/ChildEntities.cs

@@ -0,0 +1,51 @@
+using System.Collections.Generic;
+using System.Linq;
+using Xenko.Core.Mathematics;
+using Xenko.Engine;
+
+namespace Tutorials.Basics {
+    /// <summary>
+    /// This script is used to demonstrate how we can get child entities of an entity
+    /// </summary>
+    public class ChildEntities : SyncScript {
+        Entity child0;
+        Entity child1;
+        List<Entity> children;
+
+        public override void Start() { 
+            //We can get a child by using GetChild(). This takes an index number starting at 0
+            child0 = Entity.GetChild(0);
+            child1 = Entity.GetChild(1);
+            //var nonExistinChild = Entity.GetChild(2); //If we would try to get Child 3 (which doesn't exist), we would get an exception
+
+            //We retrieve all children from our entity and store it in a list. 
+            //NOTE: This does not include any subchildren of those children
+            children = Entity.GetChildren().ToList();
+        }
+
+        public override void Update() {
+            int drawX = 30, drawY = 200, increment = 20;
+
+            //We print the name of the our entity
+            DebugText.TextColor = Color.Blue;
+            DebugText.Print(Entity.Name, new Int2(drawX, drawY));
+
+            //we loop over all the children that we have found and display their name
+            foreach (var child in children) {
+
+                //We print the name of the child
+                drawY += increment;
+                DebugText.TextColor = Color.Yellow;
+                DebugText.Print(child.Name, new Int2(drawX + increment, drawY));
+
+                //It is possible that this child, also has children. We retrieve them, loop over them and print their name too
+                var subChildren = child.GetChildren().ToList();
+                foreach (var subChild in subChildren) {
+                    drawY += increment;
+                    DebugText.TextColor = Color.Green;
+                    DebugText.Print(subChild.Name, new Int2(drawX + (increment*2), drawY));
+                }
+            }
+        }
+    }
+}

+ 42 - 0
Tutorials/Tutorials/Basics/CloneEntity.cs

@@ -0,0 +1,42 @@
+using Xenko.Core.Mathematics;
+using Xenko.Engine;
+
+namespace Tutorials.Basics {
+    /// <summary>
+    /// This script demonstrates how to clone an existing entity and how cloned entities can be added to the scene hierarchy.
+    /// </summary>
+    public class CloneEntity : SyncScript {
+        public Entity entityToClone;
+        Entity entityClone0;
+        Entity entityClone1;
+        Entity entityClone2;
+
+        public override void Start() {
+            //The Clone method clones an existing entity. 
+            //However, if we don't add it to the scene, we will never get to see it.
+            entityClone0 = entityToClone.Clone();
+            entityClone0.Transform.Position += new Vector3(-2, 0, 0);
+
+            //We can add a cloned entity to the root of the scene. 
+            //The cloned entity will be at the same worldposition as the original entity.
+            entityClone1 = entityToClone.Clone();
+            SceneSystem.SceneInstance.RootScene.Entities.Add(entityClone1);
+            entityClone1.Transform.Position += new Vector3(-1, 0, 0); //Move it to the right so that we can see it
+            entityClone1.Transform.Scale = new Vector3(0.5f);
+
+            //We can also add a cloned entity as a child of an existing entity. 
+            //That means it will use the parent world position + original entity local position
+            entityClone2 = entityToClone.Clone();
+            entityClone2.Transform.Parent = Entity.Transform;
+            entityClone2.Transform.Position += new Vector3(1, 0, 0); //Move it to the left so that we can see it
+            entityClone2.Transform.Scale = new Vector3(0.5f);           
+        }
+
+        public override void Update() {
+            DebugText.TextColor = Color.Red;
+            DebugText.Print("Entity clone 0 has not been added to the scene.", new Int2(200, 80));
+            DebugText.Print("Entity clone 1 is in the root of the scene.", new Int2(200, 120));
+            DebugText.Print("Entity clone 2 is a child of the blue theapot.", new Int2(200, 400));
+        }
+    }
+}

+ 1 - 0
Tutorials/Tutorials/Basics/GettingTheEntity.cs

@@ -31,6 +31,7 @@ namespace Tutorials.Basics {
         //Updates every frame
         public override void Update() {
             //Using the 'DebugText.Print' command, we can quickly print information to the screen
+            //NOTE: DebugText only works when debugging the game. During release it is automatically disabled
             DebugText.TextColor = Color.Red;
             DebugText.Print(parentName, new Int2(10, 20));
             DebugText.Print(name, new Int2(30, 40));

+ 10 - 0
en/tutorials/csharpbasics/childEntities.md

@@ -0,0 +1,10 @@
+# Children of entities
+You can find this sample in the tutorial project: **Scenes** -> **Basics** -> **Child entities** 
+
+## Explanation
+This C# basics tutorial covers how to get an enties children. Since those children are also entities, we can retrieve their children too.
+
+![Editor properties](media/child-entities.png)
+
+## Code
+[!code-csharp[Entity](..\..\..\Tutorials\Tutorials\Basics\ChildEntities.cs)]

+ 10 - 0
en/tutorials/csharpbasics/cloningEntities.md

@@ -0,0 +1,10 @@
+# Cloning an entity
+You can find this sample in the tutorial project: **Scenes** -> **Basics** -> **Cloning entities** 
+
+## Explanation
+This C# basics tutorial covers how to clone an existing entity and how to add that clone to the scene. A cloned entity is an exact copy which means that the Transformd and all other components are copied to.
+
+![Editor properties](media/cloning-entities.png)
+
+## Code
+[!code-csharp[Entity](..\..\..\Tutorials\Tutorials\Basics\CloneEntity.cs)]

+ 0 - 9
en/tutorials/csharpbasics/destroyingEntities.md

@@ -1,9 +0,0 @@
-# Destroying an entity
-This C# basics tutorial covers the entity object.
-
-## Explanation
-When a script is attached to an entity in the scene, we can access all properties of that Entity by using the 'Entity' property. We can find its name, its parent and its scene.
-
-## Code
-You can find this sample in the tutorial project 
-<source>

+ 1 - 1
en/tutorials/csharpbasics/editorProperties.md

@@ -2,7 +2,7 @@
 You can find this sample in the tutorial project: **Scenes** -> **Basics** -> **Editor properties** 
 
 ## Explanation
-This C# basics tutorial covers how to expose editor properties for Xenko game studio. By delcaring a public variable at the top of our script, we can create editor properties. Some of the most common properties are demonstrated.
+This C# basics tutorial covers how to expose editor properties for Xenko game studio. By creating a public variable at the top of our script, we can create editor properties. Some of the most common properties are demonstrated.
 
 ![Editor properties](media/editor-properties.png)
 

+ 0 - 9
en/tutorials/csharpbasics/getButton.md

@@ -1,9 +0,0 @@
-# Get Button
-This C# basics tutorial covers the entity object.
-
-## Explanation
-When a script is attached to an entity in the scene, we can access all properties of that Entity by using the 'Entity' property. We can find its name, its parent and its scene.
-
-## Code
-You can find this sample in the tutorial project 
-<source>

+ 0 - 9
en/tutorials/csharpbasics/getKey.md

@@ -1,9 +0,0 @@
-# C# basics - Getting the entity 
-This C# basics tutorial covers the entity object.
-
-## Explanation
-When a script is attached to an entity in the scene, we can access all properties of that Entity by using the 'Entity' property. We can find its name, its parent and its scene.
-
-## Code
-You can find this sample in the tutorial project 
-<source>

+ 0 - 9
en/tutorials/csharpbasics/getMouse.md

@@ -1,9 +0,0 @@
-# C# basics - Getting the entity 
-This C# basics tutorial covers the entity object.
-
-## Explanation
-When a script is attached to an entity in the scene, we can access all properties of that Entity by using the 'Entity' property. We can find its name, its parent and its scene.
-
-## Code
-You can find this sample in the tutorial project 
-<source>

+ 6 - 6
en/tutorials/csharpbasics/index.md

@@ -1,16 +1,16 @@
 # C# Basics
-These tutorials cover intermediate topics. You should be familiar with the Basics before you dive in to these tutorials.
+These tutorials cover the absolute basics of using C# when working with the Xenko game engine. Start here if you are new to Xenko or progamming. Althoug having some coding experience is useful, it is not mandatory to get started with these tutorials.
 
-You can try out each individual script in by creating a new project and use the API tutorials example template. Each script is demonstrated a new scene.
+IN REVIEW: You can try out each individual script in by creating a new project and use the API tutorials example template. Each script is demonstrated a new scene.
 
 * [Getting the Entity](entity.md)
-* [Delta time](deltaTime.md) 
+* [Child entities](childentities.md)
 * [Transform Position](transformPosition.md) 
 * [Editor properties](editorProperties.md) 
 * [Getting a component](getComponent.md) 
-* [Instantiating entities](instantiatingentities.md) 
-* [Destroing entities](destroyingentities.md) 
-* [Look at](lookAt.md) 
+* [Delta time](deltaTime.md) 
+* [Cloning an entity](cloningEntities.md) 
+* [Removing an entity](removeEntities.md) 
 * [GetKey](getKey.md) 
 * [GetMouse](getMouse.md) 
 * [GetButton](getButton.md) 

+ 0 - 9
en/tutorials/csharpbasics/instantiatingEntities.md

@@ -1,9 +0,0 @@
-# C# basics - Getting the entity 
-This C# basics tutorial covers the entity object.
-
-## Explanation
-When a script is attached to an entity in the scene, we can access all properties of that Entity by using the 'Entity' property. We can find its name, its parent and its scene.
-
-## Code
-You can find this sample in the tutorial project 
-<source>

+ 0 - 9
en/tutorials/csharpbasics/loadScene.md

@@ -1,9 +0,0 @@
-# C# basics - Getting the entity 
-This C# basics tutorial covers the entity object.
-
-## Explanation
-When a script is attached to an entity in the scene, we can access all properties of that Entity by using the 'Entity' property. We can find its name, its parent and its scene.
-
-## Code
-You can find this sample in the tutorial project 
-<source>

+ 0 - 9
en/tutorials/csharpbasics/lookAt.md

@@ -1,9 +0,0 @@
-# C# basics - Getting the entity 
-This C# basics tutorial covers the entity object.
-
-## Explanation
-When a script is attached to an entity in the scene, we can access all properties of that Entity by using the 'Entity' property. We can find its name, its parent and its scene.
-
-## Code
-You can find this sample in the tutorial project 
-<source>

+ 3 - 0
en/tutorials/csharpbasics/media/child-entities.png

@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:33be9ed2bcdb29a834dace1dc815003fa578a7cf836f44f0cf84844c070a20ac
+size 208405

+ 3 - 0
en/tutorials/csharpbasics/media/cloning-entities.png

@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:e57920f67c507d87c3270c30a8f91dfad2784019f30a40b1486fffdf4def2371
+size 115945

+ 3 - 14
en/tutorials/index.md

@@ -13,17 +13,6 @@ These pages contain tutorials to learn more about the Xenko game engine
 All C# tutorials have code that you can try out yourself by downloading the tutorials project here <DOWNLOAD LINK> (or perhaps as a template?).
 
 
-## [C# basics](csharpbasics/index.md)
-These tutorials cover the absolute basics of using C# when working with the Xenko game engine. Start here if you are new to Xenko or progamming. Althoug having some coding experience is useful, it is not mandatory to get started with these tutorials.
-
-
-## [C# intermediate](csharpintermediate/index.md)
-These tutorials cover intermediate tutorial topics when programming with Xenko.
-
-
-## [C# advanced](csharpadvanced/index.md)
-These tutorials cover advanced tutorial topics when programming with Xenko.
-
-
-# Editor 
-
+| [C# basics](csharpbasics/index.md) | [C# intermediate](csharpintermediate/index.md) | [C# advanced](csharpadvanced/index.md) |                                               
+|---------------------------|----------------|----------------|
+| ![Editor properties](media/tutorial_basics.png) |![Editor properties](media/tutorial_intermediate.png) |![Editor properties](media/tutorial_advanced.png)

+ 3 - 0
en/tutorials/media/tutorial_advanced.png

@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:4aef0f50d837664433cf5dbe9112ac1cd78ab1c67475b75d06fd98415febf8ed
+size 25597

+ 3 - 0
en/tutorials/media/tutorial_basics.png

@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:8da14dd4f4d5e25604de9351fd5d7a163981ac388936c080fa345c678764b49f
+size 25711

+ 3 - 0
en/tutorials/media/tutorial_intermediate.png

@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:c049133a26fedf5eb2ce29f67fe46a55f3d4ee3ae6e809cc7f1041a691608c5a
+size 27428

+ 9 - 7
en/tutorials/toc.md

@@ -2,19 +2,21 @@
 # [Tutorials](index.md)
 ## [C# basics](csharpbasics/index.md)
 ### [Getting the Entity](csharpbasics/entity.md)
+### [Child entities](csharpbasics/childentities.md) 
 ### [DeltaTime](csharpbasics/deltaTime.md) 
 ### [Transform Position](csharpbasics/transformPosition.md) 
 ### [Editor properties](csharpbasics/editorproperties.md) 
 ### [Getting a component](csharpbasics/getcomponent.md) 
-### [Instianting entities](csharpbasics/instantiatingentities.md) 
-### [Destroing entities](csharpbasics/destroyingentities.md) 
-### [Look at](csharpbasics/lookAt.md) 
-### [GetKey](csharpbasics/getKey.md) 
-### [GetMouse](csharpbasics/getMouse.md) 
-### [GetButton](csharpbasics/getButton.md) 
+### [Cloning an entity](csharpbasics/cloningEntities.md) 
+### [Removing an entity](csharpbasics/destroyingentities.md) soon...
+### [GetKey](csharpbasics/getKey.md) soon...
+### [GetMouse](csharpbasics/getMouse.md) soon...
+### [GetButton](csharpbasics/getButton.md) soon...
 
 ## [C# intermediate](csharpintermediate/index.md)
-### [Raycasting](csharpintermediate/raycasting.md)
+### [Raycasting](csharpintermediate/raycasting.md) soon...
+### [Switching a scene](csharpintermediate/switchingscenes.md)soon...
+### [Loading a child scene](csharpintermediate/loadingchildscene.md)soon...
 
 ## [C# advanced](csharpadvanced/index.md)
 ### [Shader](csharpadvanced/shader.md)