Unity3D 官方基础教程 Creating Scenes

来源:互联网 发布:资海网络集团怎么样 编辑:程序博客网 时间:2024/06/12 01:01

Creating Scenes(创建场景)

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 Componentmenu. 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.

当你选中一个预制件或者动画对象时,你可以使用Component来增加它的功能,请看Component Reference来了解不同的Component的详细情况。脚本也是组件的一种,要增加组件时,仅需要选中物体,然后从组件菜单中选择一个组件即可,这时你可以看到添加的组件出现在游戏场景的监视视图中了,脚本被包含在默认组件菜单中。

如果添加一个组件破坏了游戏对象和预设件之间的关联,你始终可以通过菜单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.

一旦你的游戏对象在场景中,你可以使用变换工具来把它放到任何你喜欢的地方。此外,你可以在检视视图中使用Transform值来微调它的位置和旋转角度。查看更多关于定位和旋转游戏对象的信息Transform Component page

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 theCamera component page.

相机是游戏的眼睛。玩家看到的一切都是通过一个或多个摄像机播放的。你可以像其它游戏对象一样定位、旋转、及父处理摄像机。相机只是一个附加了相机组件的游戏对象。因此,它可以做任何普通游戏对象可以做的事情,并且还有一些相机特有的功能。还有一些有用的摄像机脚本,它们是在你创建一个新工程时随标准资源包一起安装的。你可以通过菜单Components->Camera-Control找到它们。要了解如何更好地使用相机,请查看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.

除了一些极少数的情况,你总是需要为你的场景添加光源。有三种不同类型的光源,它们的表现有所不同,重要的是,它们能为你的游戏增加气氛和氛围,不同的光源可以完全改变你的游戏的情境,有效地利用光源将是一个重要的学习课题。要了解有关不同的光源,请查看Light component page.

0 0
原创粉丝点击
热门问题 老师的惩罚 人脸识别 我在镇武司摸鱼那些年 重生之率土为王 我在大康的咸鱼生活 盘龙之生命进化 天生仙种 凡人之先天五行 春回大明朝 姑娘不必设防,我是瞎子 水田地没耙地平怎么办 宝宝拉鸡蛋花样大便怎么办 电子琴伴奏区无旋律音怎么办 手机触摸屏摔坏了怎么办 手机充着电玩游戏卡怎么办? 4个月宝宝拉肚子怎么办 6个月宝宝上火怎么办 1月婴儿大便干燥怎么办 椰子鞋350线开了怎么办 打完篮球小腿肌肉酸痛怎么办 衣服穿少了感冒怎么办 侧手翻翻不过去怎么办 生完孩子胯宽了怎么办 小孩户口性质弄错了怎么办 4岁宝宝咳嗽很厉害怎么办 宝宝深夜咳嗽很厉害怎么办 2岁宝宝发热37.6怎么办 篮球气嘴慢跑气怎么办 4个月宝宝偏胖怎么办 4个月婴儿偏胖怎么办 6岁儿童偏胖怎么办 打篮球撞到头颈椎痛怎么办 血燥热引起的皮肤瘙痒怎么办 坐时间久了屁股疼怎么办 屁股坐久了疼怎么办 屁股坐久了痛怎么办 坐多了屁股痛怎么办 上班坐的屁股痛怎么办 膝关节手术后康复膝盖疼怎么办 上下楼膝关节疼膝盖疼怎么办 跑步后关节疼该怎么办 后滚翻翻不过去怎么办 走太多路小腿疼怎么办 踢毽子以后期盖右腿内彻疼怎么办 大学体育选修课挂了怎么办 当天贴的砖踩了怎么办 刚贴的瓷砖踩了怎么办 长胶底板太轻怎么办 乒乓球拍胶皮不粘了怎么办 乒乓球拍子胶片太滑怎么办 新买的包黏黏的怎么办