Unity3dBuildingScenesPrefabs中文翻译

上传人:仙*** 文档编号:69382531 上传时间:2022-04-05 格式:DOC 页数:5 大小:220.50KB
收藏 版权申诉 举报 下载
Unity3dBuildingScenesPrefabs中文翻译_第1页
第1页 / 共5页
Unity3dBuildingScenesPrefabs中文翻译_第2页
第2页 / 共5页
Unity3dBuildingScenesPrefabs中文翻译_第3页
第3页 / 共5页
资源描述:

《Unity3dBuildingScenesPrefabs中文翻译》由会员分享,可在线阅读,更多相关《Unity3dBuildingScenesPrefabs中文翻译(5页珍藏版)》请在装配图网上搜索。

1、 Unity3D专业论坛 翻译:seventhUnity Manual User Guide Building Scenes PrefabsPrefabs(预设件)A Prefab is a type of asset - a reusable GameObject stored in Project View. Prefabs can be inserted into any number of scenes, multiple times per scene. When you add a Prefab to a scene, you create an instance of it. A

2、ll Prefab instances are linked to the original Prefab and are essentially clones of it. No matter how many instances exist in your project, when you make any changes to the Prefab you will see the change applied to all instances. 预设件是一种资源类型存储在项目视图中的一种可重复使用的游戏对象。预设件可以多次放入到多个场景中。当你添加一个预设件到场景中,就创建了它的一个

3、实例。所有的预设件实例链接到原始预设件,基本上是它的克隆。不管你的项目存在多少实例,当你对预设件进行任何更改,你将看到这些更改将应用于所有实例。(后面统称为预设)Creating Prefabs(创建预设)In order to create a Prefab, you must make a new blank Prefab using the menu. This blank Prefab contains no GameObjects, and you cannot create an instance of it. Think of a new Prefab as an empty c

4、ontainer, waiting to be filled with GameObject data. 为了创建一个预设,你必须使用菜单构造一个新的空白预设,这个空预设不包含游戏对象,你不能创建它的一个实例。想象一个新的预设为一个空的容器,等着用游戏对象数据来填充。A new, empty Prefab. It cannot be instanced until you fill it with a GameObject.一个新的、空的预设,它不能实例化直到你用一个游戏对象来填充它To fill the Prefab, you use a GameObject that youve crea

5、ted in the scene. 要填充预设,你要使用一个场景中已经创建的游戏对象。1. Choose Assets-Create-Prefab from the menu bar and name your new Prefab. 2. In Hierarchy View, select the GameObject you wish to make into a Prefab. 3. Drag & drop the GameObject from the Hierarchy onto the new Prefab in Project View. 1. 从菜单选择Assets-Creat

6、e-Prefab并为新预设命名。2. 在层次视图中,选择你想使之成为预设的游戏对象。3. 在层次视图中拖动该对象到项目视图中的新预设上。After you have performed these steps, the GameObject and all its children have been copied into the Prefab data. The Prefab can now be re-used in multiple instances. The original GameObject in the Hierarchy has now become an instanc

7、e of the Prefab. 当你完成这些步骤之后,游戏对象和其所有子对象就已经复制到了预设的数据中。该预设现在可以在多个实例中重复使用。层次视图中的原始游戏对象已经成为了该预设的一个实例。Prefab Instances(预设实例)To create a Prefab instance in the current scene, drag the Prefab from the Project View into the Scene or Hierarchy View. This instance is linked to the Prefab, as displayed by the

8、blue text used for their name in the Hierarchy View. 要在当前场景创建预设的一个实例,从项目视图拖动预设到场景中或层次视图中。此实例是链接到该预设的,如下图在层次视图中使用蓝色文字显示的。Three of these GameObjects are linked to Prefabs. One of them is not.三个游戏对象是链接到预设的,另一个则不是 If you have selected a Prefab instance, and want to make a change that affects all instanc

9、es, you can click the Select button in the Inspector to select the source Prefab. Information about instantiating prefabs from scripts is in the Instantiating Prefabs page. 如果你选择了一个预设的实例,并希望做些改变以影响到所有实例,你可以在检视视图中单击Select按钮选择预设源 有关从脚本实例化预设的更多信息参考Instantiating PrefabsInheritance(继承)Inheritance means t

10、hat whenever the source Prefab changes, those changes are applied to all linked GameObjects. For example, if you add a new script to a Prefab, all of the linked GameObjects will instantly contain the script as well. However, it is possible to change the properties of a single instance while keeping

11、the link intact. Simply change any property of a prefab instance, and watch as the variable name becomes bold. The variable is now overridden. All overridden properties will not be affected by changes in the source Prefab. 继承是指当预设源发生变化,这些变化将应用于所有已链接的游戏对象。例如,如果添加一个新的脚本到预设,所有已链接的游戏对象都将立刻包含该脚本。但是,它有可能改

12、变一个单独实例的属性,同时保持链接。改变任何一个预设实例的属性,可以看到变量名称变为粗体,现在该变量可以被重写,所有的重写属性不会影响预设源的变化。This allows you to modify Prefab instances to make them unique from their source Prefabs without breaking the Prefab link. 这使你可以修改预设实例使它们变得独一无二,而不破坏它们与预设源之间的链接。A linked GameObject with no overrides enabled.没有可重写变量的一个已链接游戏对象A l

13、inked GameObject with several (bold) overrides enabled. 有若干个可重写变量(名称加粗的)的一个已链接游戏对象 If you want to update the source Prefab and all instances with the new overridden values, you can click the Apply button in the Inspector. If you want to discard all overrides on a particular instance, you can click t

14、he Revert button. 如果你想用新属性值覆盖更新预设源和所有实例,你可以在检视视图中点击Apply按钮。 如果你要放弃对特定实例的所有覆盖更新,您可以点击Revert按钮。Breaking and Restoring Prefab Links(破坏和恢复预设链接)There are certain actions which will break the link between a single instance and its source prefab, but the link can always be restored. Actions that will break

15、 the link: 有些行为,将破坏单个实例及其预设源之间的链接,但链接总是可以恢复的。下面的行为将破坏链接: Adding or removing a Component Adding or removing a child GameObject 添加或删除一个组件 添加或删除一个子对象These actions will prompt a warning/confirmation message about breaking the link. Confirming the action will break the link so changes to the source Prefa

16、b will no longer affect the broken instance. To restore the link, you can click either the Reconnect or Apply buttons in the Inspector of the instance. 这些行为将引起一个破坏链接的警告/确认消息。确认该行为将破坏链接,这样,更改预设源将不再影响已破坏了链接的实例。要恢复该链接,你可以在实例的检视视图中单击Reconnect或Apply按钮。 Reconnect will discard all differences from the sour

17、ce Prefab. Apply will copy all differences into the source Prefab (and therefore, all other Prefab instances) Reconnect将丢弃与预设源的所有差别。 Apply将复制所有差别到预设源中(包括所有其它预设实例)Imported Prefabs(导入预设)When you place a mesh asset into your Assets folder, Unity automatically imports the file and generates something th

18、at looks similar to a Prefab out of the mesh. This is not actually a Prefab, it is simply the asset file itself. Instancing and working with assets introduces some limitations that are not present when working with normal Prefabs. 当你放置一个网格资源到你的资源文件夹中,Unity自动导入文件并生成一些类似于一个预制的网格。这实际上不是一个预设,它只是这个资源文件本身

19、。在使用正常预设工作时,资源的实例化和使用将带来一些当前没有的限制。(什么意思)Notice the asset icon is a bit different from the Prefab icons注意资源图标与预设图标有一点不同The asset is instantiated in the scene as a GameObject, linked to the source asset instead of a normal Prefab. Components can be added and removed from this GameObject as normal. How

20、ever, you cannot apply any changes to the asset itself since this would add data to the asset file itself! If youre creating something you want to re-use, you should make the asset instance into a Prefab following the steps listed above under Creating Prefabs. 资源是作为一个游戏对象存在于场景中的实例,链接到源资源代替一个正常的预设。作为

21、正常的游戏对象,组件可以被添加和删除。但是,你不能应用任何变动到这个资源本身,因为这样将给资源文件本身添加数据!如果你创建一些你想要重复使用的东西,你应该将资源实例制成一个预设,后面的步骤列出了前文“创建预设”的从属步骤。 When you have selected an instance of an asset, the Apply button in the Inspector is replaced with an Edit button. Clicking this button will launch the editing application for your asset (e.g. Maya or Max). 当你选择了一个资源的实例,检视视图中的应用(Apply)按钮将被替换为一个编辑(Edit)按钮。点击此按钮将为你的资源启动编辑程序(如Maya或3DMAX)。

展开阅读全文
温馨提示:
1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
2: 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
3.本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
关于我们 - 网站声明 - 网站地图 - 资源地图 - 友情链接 - 网站客服 - 联系我们

copyright@ 2023-2025  zhuangpeitu.com 装配图网版权所有   联系电话:18123376007

备案号:ICP2024067431-1 川公网安备51140202000466号


本站为文档C2C交易模式,即用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知装配图网,我们立即给予删除!