当前位置:网站首页>【Unity入门计划】基本概念-预制件 Prefab
【Unity入门计划】基本概念-预制件 Prefab
2022-07-25 07:26:00 【flashinggg】
目录
官方文档
我的Unity版本
2021.3.6
1 预制件的作用
unity中我们通常需要给游戏对象添加一些比如刚体、碰撞体等组件实现一些效果,但当遇到同一个NPC、场景中的道具在场景中需要被重复使用时,如果只是一步一步重复添加组件,效率会非常低,这是我们就希望把同一种需要复制的对象打包起来,需要用的时候直接复制粘贴即可。
预制件就是unity提供给用户的一个实现上述操作的资源类型。
2 预制件的定义
- 预制件(prefab)是一种assert资源类型;
- 预制件用于存储游戏对象(GameObject)对象以及配套的组件和属性;
- 预制件充当一种模板功能,是一个可重复使用的资源模板;
3 预制件的优点
既然它是一个打包好的资源模板,那么优点就清晰可见了。它可以轻松的大范围的修改项目的内容,无需对每个单一对象进行重复编辑,节省了大量的时间。
4 预制件的创建&使用
4.1 创建
- 在文件夹右键 -> Create -> Prefab,就可以创建一个预制件;


- 将场景中想要实现复制的对象拖到这个预制件资源 -> 弹出提示框没选择Replace -> 就创建了一个可重复使用的资源模板;


- 此时, 原本的对象前面的图标也改变了,从线框 -> 实心 ;属性面板也多了Prefab属性。


4.2 使用
使用就很简单了,要么直接拖入Scene视图,要么ctrl+D复制即可。
边栏推荐
- Room database migration
- Introduction to Manhattan distance
- paddlepaddle 34 调整模型的layer结构与forward流程(实现layer的增删改与forward的修改)
- leetcode刷题:动态规划06(整数拆分)
- cesium简介
- Gan series of confrontation generation network -- Gan principle and small case of handwritten digit generation
- Boiling short drama Jianghu: nine of the ten production teams are shooting, with a head sharing fund of more than 30million, and users are addicted to paying routines
- Paper reading: UNET 3+: a full-scale connected UNET for medical image segmentation
- 【刷题笔记】搜索插入位置(二分法的活用)
- [computer explanation] NVIDIA released geforce RTX Super Series graphics cards, and the benefits of game players are coming!
猜你喜欢

First, how about qifujin

Luo min's backwater battle in qudian

Leetcode skimming: dynamic programming 06 (integer splitting)

Xinku online | cnopendata shareholder information data of A-share listed companies

Introduction to Manhattan distance

Meta is in a deep quagmire: advertisers reduce spending and withdraw from the platform

Huawei wireless device configuration wpa2-802.1x-aes security policy

QT learning diary 20 - aircraft war project

New tea, start "fighting in groups"

Wechat applet switchtab transmit parameters and receive parameters
随机推荐
QT6 with vs Code: compiling source code and basic configuration
What are runtimecompiler and runtimeonly
列表推导式
Ideal L9, can't cross a pit on the road?
Openatom xuprechain open source biweekly report | 2022.7.11-2022.7.22
Boiling short drama Jianghu: nine of the ten production teams are shooting, with a head sharing fund of more than 30million, and users are addicted to paying routines
Luo min's backwater battle in qudian
QT学习日记20——飞机大战项目
When providing digital talent services, Xi Zhi quickly opened its own digital school for each organization
DJI内推码(一码一用,限时内推)
数据提交类型 Request Payload 与 Form Data 的区别总结
SAP queries open Po (open purchase order)
一日千里,追风逐月 | 深势科技发布极致加速版分子对接引擎Uni-Docking
Leetcode skimming: dynamic programming 06 (integer splitting)
Robot framework mobile terminal Automation Test ----- 01 environment installation
Luo min from qudian, prefabricate "leeks"?
Meta is in a deep quagmire: advertisers reduce spending and withdraw from the platform
BOM overview
Default value of dart variable
Summary of differences between data submission type request payload and form data