- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
2-3预制品
Prefabs 预制品
Unity Manual User Guide Building Scenes Prefabs
用户手册-用户指南-建立场景-预制品
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. All 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.
预制品是一个资产的类型—一个存储在项目视图(面板)里可以重复使用的GameObject(游戏物体)。预制品可以被插入任何数量的场景、每个场景多次。当你添加以讹预制品到一个场景,你创建一个预制品的实例。所有的预制品实例被连接到原始的预制品,本质上是它自己的复制品(克隆)。不管如何许多实例存在于你的项目里,当你做任何更改到预制品你将看到更改被应用于所有的实例。
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 container, waiting to be filled with GameObject data.
为了创建一个预制品,你必须使用菜单件建一个新的空白预制品。这个空的预制品不包含GameObject(游戏物体),你也不能创建一个它的实例。把一个新的预制品作想象为一个空的容器,等待被用GameObject数据填充。
A new, empty Prefab. It cannot be instanced until you fill it with a GameObject.
一个新的空预制品,它不能被实例化直到你用一个GameObject填充它
To fill the Prefab, you use a GameObject that youve created in the scene.
去填充这个预制品,你使用一个你已经在场景里创建的GameObject。
Choose Assets-Create-Prefab from the menu bar and name your new Prefab.
从菜单条选择Assets-Create-Prefab并命名你新的预制品。
In Hierarchy View, select the GameObject you wish to make into a Prefab.
在层次视图(面板)里,选取你希望去制成一个预制品的GameObject
Drag drop the GameObject from the Hierarchy onto the new Prefab in Project View.
从层次拖放这个GameObject 到在项目视图里的那个新的预制品上。
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 instance of the Prefab.
你处理完这些步骤之后,GameObject以及所有它的子已经被复制到预制品的数据里。预制品现在可以被重复使用在多个实例里。在层次里的原始GameObject现在已经变成预制
原创力文档


文档评论(0)