官术网_书友最值得收藏!

Creating prefabs

Now that we have a bit of an understanding of the preceding concepts, we will take our Platform and 3D text object and create a prefab from them. We will do this twice to see the multiple ways in which this task can be accomplished; let's take a look at the steps we need to carry out:

  1. First, let's look at the Project view. Using the process from the preceding chapter, create a folder called Prefabs, as a subfolder of Assets.
  2. Select the Prefabs folder from the left side of the Project view.
  3. Right-click in the open area on the right-hand side of the Project view, slide your mouse pointer over Create, and click on Prefab:
  1. A white square should appear in Project view with a highlighted name New Prefab; name this one Test One.
  2. In the Hierarchy view, click on the Platform object and drag it down to the Test One prefab. When this is accomplished, your Test One prefab will look something like this:
  1. If you click on the arrow on the right-hand side of the prefab, you will be able to view the other objects in the Prefabsfolder:
  1. In an effort to distinguish prefabs from non-prefabs in the Hierarchy view, prefab names are colored blue:
  1. Now, delete the Test One object from the Project view. You may note that the prefab in the Hierarchy view has turned red. This is to let the designer know that master Prefab has been deleted.
  2. This time, we will click on the red Platform object in the Hierarchy view and drag it down to the now empty space in the Project view.
  3. The same Prefab object will appear again; this time, though, the name of the prefab is the name of the parent object:
主站蜘蛛池模板: 临武县| 修武县| 象州县| 望都县| 东宁县| 台江县| 游戏| 闵行区| 宁陵县| 平安县| 平湖市| 南丰县| 沅陵县| 分宜县| 永泰县| 封丘县| 册亨县| 湄潭县| 格尔木市| 长武县| 石首市| 新野县| 铜陵市| 丽水市| 辉南县| 聂拉木县| 年辖:市辖区| 吉首市| 久治县| 阳谷县| 阿鲁科尔沁旗| 英吉沙县| 朔州市| 高州市| 辛集市| 临邑县| 呈贡县| 宁夏| 马龙县| 滕州市| 左贡县|