当前位置:网站首页>【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复制即可。
边栏推荐
- 做好项目管理的10个关键点和5大措施
- Ideal L9, can't cross a pit on the road?
- 微信小程序request请求携带cookie,验证是否已登录
- Robot Framework移动端自动化测试----01环境安装
- Incremental crawler in distributed crawler
- Statistical learning -- naive Bayesian method
- SAP queries open Po (open purchase order)
- 微信小程序switchTab传参以及接收参数
- 各位老板 问一下 就是我们mysql cdc保存的是配置数据 然后kafka里面堆积的有历史
- 华为无线设备STA黑白名单配置命令
猜你喜欢

Oracle19采用自动内存管理,AWR报告显示SGA、PGA设置的过小了?

Price reduction, game, bitterness, etc., vc/pe rushed to queue up and quit in 2022

《游戏机图鉴》:一份献给游戏玩家的回忆录

RPC communication principle and project technology selection

QT6 with vs Code: compiling source code and basic configuration

用VS Code搞Qt6:编译源代码与基本配置

阿里云镜像地址&网易云镜像

数据提交类型 Request Payload 与 Form Data 的区别总结

RPC通信原理与项目技术选型

Configuring WAPI certificate security policy for Huawei wireless devices
随机推荐
线代(矩阵‘)
2022 Tiangong cup ctf--- crypto1 WP
Beijing internal promotion | Microsoft STCA recruits nlp/ir/dl research interns (remote)
【刷题笔记】搜索旋转排序数组
华为无线设备配置WPA2-802.1X-AES安全策略
Gan series of confrontation generation network -- Gan principle and small case of handwritten digit generation
When importing data in batches, you always prompt "failure reason: SQL parsing failure: parsing file failure:: null". What's the matter?
Huawei wireless device sta black and white list configuration command
各位老板 问一下 就是我们mysql cdc保存的是配置数据 然后kafka里面堆积的有历史
列表推导式
Pads export Gerber file
Wechat applet wx.request interface
Leetcode skimming: dynamic programming 06 (integer splitting)
[programmer 2 Civil Servant] IV. common problems
First, how about qifujin
第一启富金怎么样
【程序员2公务员】一、基本认知
paddlepaddle 34 调整模型的layer结构与forward流程(实现layer的增删改与forward的修改)
[notes for question brushing] search the insertion position (flexible use of dichotomy)
Statistical learning -- naive Bayesian method