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

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

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. 一个没有覆盖GameObject连接启用


A linked GameObject with one override enabled. 一个有覆盖GameObject的连接启用

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 the Revert button.


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 the link:


  • Adding or removing a Component 添加或移除一个组件
  • Adding or removing a child GameObject 添加或移除一个子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 Prefab 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 will discard all differences from the source Prefab. Reconnect(重新连接)将放弃从源预制品的所有差异。
  • Apply will copy all differences into the source Prefab (and therefore, all other Prefab instances)
  • Apply(应用)将复制所有差异到源预制品(因此,含有所有其它预制品实例)

Imported Prefabs 引入预制品

When you place a mesh asset into your Assets folder, Unity automatically imports the file and generates something that 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.


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. However, you cannot apply any changes to the asset itself since this would add data to the asset file itself! If you're creating something you want to re-use, you should make the asset instance into a Prefab following the steps listed above under "Creating Prefabs".


  • 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 或MAX)。

发表评论0条 】