Przeglądaj źródła

Added instantiating prefabs tutorial. Fixed some urls

Jorn Theunisen 6 lat temu
rodzic
commit
abae364500

+ 1 - 1
en/manual/game-studio/prefabs/create-a-prefab.md

@@ -35,7 +35,7 @@ You can create new prefabs from modified prefabs. For example, you can instantia
 ## See also
 ## See also
 
 
 * [Prefab index](index.md)
 * [Prefab index](index.md)
-* [Use prefabs](index.md)
+* [Use prefabs](use-prefabs.md)
 * [Edit prefabs](edit-prefabs.md)
 * [Edit prefabs](edit-prefabs.md)
 * [Nested prefabs](nested-prefabs.md)
 * [Nested prefabs](nested-prefabs.md)
 * [Override prefab properties](override-prefab-properties.md)
 * [Override prefab properties](override-prefab-properties.md)

+ 1 - 1
en/manual/game-studio/prefabs/edit-prefabs.md

@@ -50,7 +50,7 @@ This video demonstrates what happens when we make changes to the prefab. The Sce
 
 
 * [Prefab index](index.md)
 * [Prefab index](index.md)
 * [Create a prefab](create-a-prefab.md)
 * [Create a prefab](create-a-prefab.md)
-* [Use prefabs](index.md)
+* [Use prefabs](use-prefabs.md)
 * [Nested prefabs](nested-prefabs.md)
 * [Nested prefabs](nested-prefabs.md)
 * [Override prefab properties](override-prefab-properties.md)
 * [Override prefab properties](override-prefab-properties.md)
 * [Prefab models](prefab-models.md)
 * [Prefab models](prefab-models.md)

+ 1 - 1
en/manual/game-studio/prefabs/nested-prefabs.md

@@ -23,7 +23,7 @@ In the center pane, we already have a prefab named **Lamp**. In the right pane,
 
 
 * [Prefab index](index.md)
 * [Prefab index](index.md)
 * [Create a prefab](create-a-prefab.md)
 * [Create a prefab](create-a-prefab.md)
-* [Use prefabs](index.md)
+* [Use prefabs](use-prefabs.md)
 * [Edit prefabs](edit-prefabs.md)
 * [Edit prefabs](edit-prefabs.md)
 * [Override prefab properties](override-prefab-properties.md)
 * [Override prefab properties](override-prefab-properties.md)
 * [Prefab models](prefab-models.md)
 * [Prefab models](prefab-models.md)

+ 1 - 1
en/manual/game-studio/prefabs/override-prefab-properties.md

@@ -70,7 +70,7 @@ Four of the lampposts now have a green light. The fifth is still red, as overrid
 
 
 * [Prefab index](index.md)
 * [Prefab index](index.md)
 * [Create a prefab](create-a-prefab.md)
 * [Create a prefab](create-a-prefab.md)
-* [Use prefabs](index.md)
+* [Use prefabs](use-prefabs.md)
 * [Edit prefabs](edit-prefabs.md)
 * [Edit prefabs](edit-prefabs.md)
 * [Nested prefabs](nested-prefabs.md)
 * [Nested prefabs](nested-prefabs.md)
 * [Prefab models](prefab-models.md)
 * [Prefab models](prefab-models.md)

+ 19 - 0
en/tutorials/csharpbeginner/index.md

@@ -262,3 +262,22 @@ These tutorials cover the beginner principles of using C# when working with the
     ](loading-content.md) 
     ](loading-content.md) 
 </div>
 </div>
 
 
+<div class='tutorial'> 
+    [
+    <div class='tutorial_title'>
+       <h2>Instantiating prefabs</h2>
+    </div>
+    <div class='xk-documentation-image'>
+        ![Instantiating prefabs tutorial](media/instantiating-prefabs_thumb.png "Instantiating prefabs tutorial") 
+    </div>
+    <div class='tutorial_description'>
+        <ul>
+            <li>Instantiate prefab</li> 
+            <li>Load prefab from content</li> 
+            <li>Parent prefab entity</li> 
+        </ul>
+    </div>
+    ](instantiating-prefabs.md) 
+</div>
+
+

+ 10 - 0
en/tutorials/csharpbeginner/instantiating-prefabs.md

@@ -0,0 +1,10 @@
+# Instantiating Prefabs
+You can find this sample in the tutorial project: **Menu** &rarr; **Instantiating prefabs** 
+
+## Explanation
+This C# Beginner tutorial covers how to instantiate prefabs. A prefab is a "master" version of an object that you can reuse wherever you need. When you change the prefab, every instance of the prefab changes too. A prefab that is instantiated by code does not give you a new prefab object, but instead gives you a list of entities. As long as these entities are not added to the scene, they wont be visible and attached scripts will not be executed. 
+
+![Instantiating Prefabs](media/instantiating-prefabs.png)
+
+## Code
+[!code-csharp[Instantiating Prefabs](..\..\..\..\xenko\samples\Tutorials\CSharpBeginner\CSharpBeginner\CSharpBeginner.Game\Code\InstantiatingPrefabsDemo.cs)]

+ 3 - 0
en/tutorials/csharpbeginner/media/instantiating-prefabs.png

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

+ 3 - 0
en/tutorials/csharpbeginner/media/instantiating-prefabs_thumb.png

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

+ 2 - 1
en/tutorials/toc.md

@@ -14,4 +14,5 @@
 ### [Mouse input](csharpbeginner/mouse-input.md) 
 ### [Mouse input](csharpbeginner/mouse-input.md) 
 ### [Virtual buttons](csharpbeginner/virtual-buttons.md)
 ### [Virtual buttons](csharpbeginner/virtual-buttons.md)
 ### [Linear Interpolation](csharpbeginner/linear-interpolation.md)
 ### [Linear Interpolation](csharpbeginner/linear-interpolation.md)
-### [Loading content](csharpbeginner/loading-content.md)
+### [Loading content](csharpbeginner/loading-content.md)
+### [Instantiating prefabs](csharpbeginner/instantiating-prefabs.md)