untiy3d2-1游戏对象.doc

上传人:公**** 文档编号:561924951 上传时间:2023-12-18 格式:DOC 页数:4 大小:101KB
返回 下载 相关 举报
untiy3d2-1游戏对象.doc_第1页
第1页 / 共4页
untiy3d2-1游戏对象.doc_第2页
第2页 / 共4页
untiy3d2-1游戏对象.doc_第3页
第3页 / 共4页
untiy3d2-1游戏对象.doc_第4页
第4页 / 共4页
亲,该文档总共4页,全部预览完了,如果喜欢就下载吧!
资源描述

《untiy3d2-1游戏对象.doc》由会员分享,可在线阅读,更多相关《untiy3d2-1游戏对象.doc(4页珍藏版)》请在金锄头文库上搜索。

1、GameObjects 游戏对象(物体)Unity Manual User Guide Building Scenes GameObjects Unity 手册-用户指南-建立场景-游戏对象(物体)GameObjects are the most important objects in Unity. It is very important to understand what a GameObject is, and how it can be used. This page will explain all that for you. 游戏对象(物体)是Unity里最重要的对象。了解一个

2、游戏对象(物体)是什么以及如何使用它是非常重要的。本页将为你解释一切。What are GameObjects?游戏对象是什么?Every object in your game is a GameObject. However, GameObjects dont do anything on their own. They need special properties before they can become a character, an environment, or a special effect. But every one of these objects does so

3、many different things. If every object is a GameObject, how do we differentiate an interactive power-up object from a static room? What makes these GameObjects different from each other? 你的游戏中的每个物体是一个游戏对象。然而,游戏对象它们自己不做任何事情。在它们能成为一个人物、一个环境或有一个特殊效果之前它们需要指定属性。但是任意一个这样的对象能做一样多的不同事情。如果每个对象(物体)是一个游戏对象(物体)

4、,我们如何从一个静态空间区分加电的互动对象?什么使得这些游戏对象彼此互不相同?The answer to this question is that GameObjects are containers. They are empty boxes which can hold the different pieces that make up a lightmapped island or a physics-driven car. So to really understand GameObjects, you have to understand these pieces; they ar

5、e called Components. Depending on what kind of object you want to create, you will add different combinations of Components to the GameObject. Think of a GameObject as an empty cooking pot, and Components as different ingredients that make up your recipe of gameplay. You can read more about Componen

6、ts here, but we recommend you finish reading this page first. 这个问题的答案是GameObjects(游戏对象(物体)是容器。它们是那个可以容纳组成一个灯光映射的岛屿的不同事项或一个物理驱动的汽车的空箱。因此要真正理解GameObjects(游戏对象),你必须理解这些事项;它们被称为Components(组件)。根据你想创建什么样的对象,你将添加不同成分的组件到GameObject(游戏对象(物体)里)。把一个GameObject(游戏对象(物体)想象成一个空的烹饪锅,而组件作为组成你游戏玩法食谱的不同成分。你可以阅读更多的组件在这

7、里。但是我们建议你首先阅读完本页。注意:据上面的翻译理解,GameObject 译成游戏物体比较合适。以下翻译成游戏物体The GameObject-Component Relationship 游戏物体(对象)-组件关系We now know that a GameObject contains Components. Well explore this relationship by discussing the most common Component - the Transform Component. With any Unity Scene open, create a new

8、GameObject (using Shift-Control-N on Windows or Shift-Command-N on Mac), select it and take a look at the Inspector. 我们现在知道一个游戏物体(对象)包含组件。我们将探讨这种包含关系,通过讨论常见的公共组件- Transform 组件(变换组件)。利用任何Unity打开的场景,创建一个新的游戏物体(对象)(在windows上使用Shift+Ctrl+N键或在MAC上Shift+Command+N键),选取它并关注(属性)检视器。The Inspector of an Empty

9、GameObject 一个空的游戏物体的(属性)检视器Notice that an empty GameObject still contains a Name, a Tag, and a Layer. Every GameObject also contains a Transform Component. It is impossible to create a GameObject in Unity without a Transform Component. All of the GameObjects Transform properties are enabled by its u

10、se of the Transform Component. The Transform Component just happens to be critical to all GameObjects, so each GameObject has one. But GameObjects can contain other Components as well. 注意一个空的游戏物体(对象)仍就包含一个名称、标签以及涂层。The Main Camera, added to each scene by default 主摄像机,默认添加到每个场景Taking a look at the Ma

11、in Camera GameObject, we can see that it contains a different collection of Components. Specifically, a Camera Component, a GUILayer, a Flare Layer, and an Audio Listener. All of these Components provide additional functionality to the GameObject. Without them, there would be nothing rendering the g

12、raphics of the game for the person playing! Rigidbodies, Colliders, Particles, and Audio are all different Components (or combinations thereof) that can be added to any given GameObject. 关注主摄像机游戏物体(对象),我们可以看到它包含不同的组件集合。具体而言,一个摄像机组件、一个GUI涂层,一个眩光涂层以及一个音频接收器。所有的这些组件都提供了额外的功能给游戏物体(对象)。没有它们,就将没有图形渲染的游戏让人

13、玩!刚体、碰撞器、粒子以及音频都是不同的组件(或它们的组合)可以被添加到任何给定的游戏物体(对象)。The Transform Component 变换组件The Transform Component is one of the most important Components. It defines the GameObjects position, rotation, and scale in the game world/Scene View. If a GameObject did not have a Transform Component, it would be nothin

14、g more than some information in the computers memory. It effectively would not exist in the world. The Transform Component also enables a concept called Parenting, which is utilized through the Unity Editor and is a critical part of working with GameObjects. If you would like to learn more about the

15、 Transform Component and Parenting, please read the Transform Component Reference page. 变换组件是最重要的组件之一。它定义了游戏物体(对象)在游戏世界里或场景视图里的坐标(位置)、旋转、以及伸缩。如果一个游戏物体(对象)没有一个变换组件,它将只不过是在计算机内存了的一些信息。它将有效的不存在与世界。变换组件还启用了一个被称为父的概念,是通过使用Unity编辑器与游戏物体一起工作的重要组成部分。如果你想学习更多关于变换组件和父,请阅读变换组件参考页。The GameObject-Script Relation

16、ship 游戏物体(对象)-脚本关系When you create a script and and attach it to a GameObject, the script appears in the GameObjects Inspector just like a Component. This is because scripts become Components when they are saved. In technical terms, a script compiles as a type of Component, and is treated like any other Component by the Unity engine. 当你创建一个脚本并它放在一个游戏物体(对象)上,这个脚本显示在游戏物体(对象)的检视器里,就像一个组件。这是因为脚本变成组件当它们保存时。在技术方面,一个脚本编译为组件的一种类型,如同通

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 生活休闲 > 科普知识

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号