Unity3D基础教程1-3:创建场景(Creating Scenes)

2014-08-05 21:59:17|?次阅读|上传:huigezrx【已有?条评论】发表评论

关键词:虚拟现实, 游戏, Unity3D|来源:唯设编程网

Unity Manual > User Guide > Unity Basics > Creating Scenes

Unity 手册->用户指南->Unity基础->建立场景

Scenes contain the objects of your game. They can be used to create a main menu, individual levels, and anything else. Think of each unique Scene file as a unique level. In each Scene, you will place your environments, obstacles, and decorations, essentially designing and building your game in pieces.

场景包含你游戏的对象。它们可以被用于创建一个主菜单、个人级别、以及其它东西。思考每一个独立场景做为单一级别文件。在每个场景里,你将放置你的环境、障碍和装饰,主要设计和建造你的游戏部件。

Instancing Prefabs 实例化预制品

Use the method described in the last section to create a Prefab. You can also read more details about Prefabs here. Once you've created a Prefab, you can quickly and easily make copies of the Prefab, called an Instance. To create an instance of any Prefab, drag the Prefab from the Project View to the Hierarchy or Scene View. Now you have a unique instance of your Prefab to position and tweak as you like.

使用上一节所述方法去创建一个预制品。你还可以阅读更多关于预制品细节在这里。一旦你已经建立一个预制品,你可以快速和方便的利用预制的副本,称为一个实例。要创建任何预制品的一个实例,从项目视图拖动预制品到层次面板或场景视图,现在你有一个你预制品的一个独特的实例去安置和调整你想要的。

Adding Component & Scripts 添加组件和脚本

When you have a Prefab or any GameObject highlighted, you can add additional functionality to it by using Components. Please view the Component Reference for details about all the different Components. Scripts are a type of Component. To add a Component, just highlight your GameObject and select a Component from the Component menu. You will then see the Component appear in the Inspector of the GameObject. Scripts are also contained in the Component menu by default.

当你有一个预制品或任何突出显示的游戏对象,通过使用组件,你可以添加附加的功能。请查看关于所有不同组件的组件参考详细资料。脚本是组件的一个类型。添加一个组件,只需突出显示你游戏对象和从组件菜单选择一个组件。你将看到这个游戏对象的组件显示在检视器面板里,脚本也是同样包含在组件默认菜单里。

If adding a Component breaks the GameObject's connection to its Prefab, you can always use GameObject->Apply Changes to Prefab from the menu to re-establish the link.

如果添加一个组件断开了游戏对象的连接到它的预制品,你总可以从菜单使用GameObject->Apply Changes to Prefab(游戏对象->应用更改到预制品)去重建这个链接

Placing GameObjects 放置游戏对象

Once your GameObject is in the scene, you can use the Transform Tools to position it wherever you like. Additionally, you can use the Transform values in the Inspector to fine-tune placement and rotation. Please view the Transform Component page for more information about positioning and rotating GameObjects.

一旦你的游戏对象在场景里,你可以使用变换功能工具去安置它到你喜欢的地方。此外,你可以使用检视器面板里变换属性值去精确调整位置和旋转。请查看更多信息关于位置和旋转游戏对象的变换组件页面。

Working with Cameras 用摄像机工作

Cameras are the eyes of your game. Everything the player will see when playing is through one or more cameras. You can position, rotate, and parent cameras just like any other GameObject. A camera is just a GameObject with a Camera Component attached to it. Therefore it can do anything a regular GameObject can do, and then some camera-specific functions too. There are also some helpful Camera scripts that are installed with the standard assets package when you create a new project. You can find them in Components->Camera-Control from the menu. There are some additional aspects to cameras which will be good to understand. To read about cameras, view the Camera component page.

摄像机是你游戏的眼睛。播放器的每件事物在播放时是通过一个或多个摄像机看到。你可以决定位置、旋转以及子类化摄像机只需像任何其它游戏对象。一个摄像机仅是和一个游戏对象使用一个摄像机组件连接。因此它可以做一个游戏对象可做的任何事情,然后也做一些摄像机特定的功能。还有一些有用的摄像机脚本,与标准的资产包安装,当你创建一个新的项目时。 你可以发现它们从菜单You can find them in Components->Camera-Control from the menu.你你你从Components->Camera-Control组件->摄像机-控制)。To read about cameras, view the Camera component page .阅读关于摄像机,查看摄像机组件页

Lights 灯光

Except for some very few cases, you will always need to add Lights to your scene. There are three different types of lights, and all of them behave a little differently from each other. The important thing is that they add atmosphere and ambience to your game. Different lighting can completely change the mood of your game, and using lights effectively will be an important subject to learn. To read about the different lights, please view the Light component page.

Except for some very few cases, you will always need to add Lights to your scene.除了一些极少数情况下,你永远需要添加光到你的场景。 There are three different types of lights, and all of them behave a little differently from each other.有三种不同类型的光,以及他们互相有一点不同行为。The important thing is that they add atmosphere and ambience to your game.重要的事情是,它们添加大气层和氛围到你的游戏。 Different lighting can completely change the mood of your game, and using lights effectively will be an important subject to learn.不同的光可完全改变你的游戏状态,以及有效地使用光将是一个重要课题学习。 To read about the different lights, please view the Light component page .要了解有关不同的光,请查看光组件页

发表评论0条 】
网友评论(共?条评论)..
Unity3D基础教程1-3:创建场景(Creating Scenes)