[第六天]从0开始的UnityAR手机游戏开发-如何汇入Unity Package到Unity和Unity使用Vuforia插件的基本设置

  • Unity Package汇入方式

Unity Package汇入Unity有以下3种方式

  1. 双击两下
    https://ithelp.ithome.com.tw/upload/images/20210920/20140569P6dL0u4qmP.png

  2. 将Unity Package拖曳到Unity内的Project
    https://ithelp.ithome.com.tw/upload/images/20210920/20140569Wz2eiGiv81.png

3.在专案内点击Assets→Import Package→Custom Package...会跳出Import package视窗,选择要汇入的Package
https://ithelp.ithome.com.tw/upload/images/20210920/20140569E5KVchZQ7q.png


  • Unity使用Vuforia插件的基本设置

在Project的Scene资料夹点击右键→Create→Scene→帮新场景取名
https://ithelp.ithome.com.tw/upload/images/20210920/20140569XjBp9Y5vk9.png

滑鼠左键连点两下刚创建的新场景让Hierarchy变为新创建的场景
https://ithelp.ithome.com.tw/upload/images/20210920/20140569fZrNIzAFYD.png

将场景的Main Camera删除,在Hierarchy点击右键新建Vuforia Engine的AR Camera
https://ithelp.ithome.com.tw/upload/images/20210920/20140569kEaXmnV8qe.png

在Hierarchy点击右键新建Vuforia Engine的Image
https://ithelp.ithome.com.tw/upload/images/20210920/20140569EN4dIX4zxD.png

左键点击一下ImageTarget後Inspector会跳出ImageTarget的元件资讯,点击两下Scene会跳到该物件的位置
https://ithelp.ithome.com.tw/upload/images/20210920/20140569Xa6evYHqp4.png

在ImageTarget的元件资讯有一个Image Target Behaviour脚本,将Database和Image Target改为刚刚汇入的资料库和卡片
https://ithelp.ithome.com.tw/upload/images/20210920/20140569qwMW8FSgYE.png

选取ImageTarget後点击右键新增3D Object→Cube为子物件。
没有将要显示的物件设为ImageTarget的子物件的话,镜头照到图卡不会显示任何物体!!!
https://ithelp.ithome.com.tw/upload/images/20210920/20140569LesUmmzARU.png

将新增的子物件使用移动和缩放工具调整大小并移动至图卡上方
https://ithelp.ithome.com.tw/upload/images/20210920/20140569E8shh7DzSz.png

按下启动,如果电脑有内建或外接的镜头Unity会抓取那个镜头来使用,Unity拍到辨识图卡时就会出现刚刚新建的子物件欧!
https://ithelp.ithome.com.tw/upload/images/20210920/201405691BLkIo78Fv.png


记得要按CTRL+S存档!!!
记得要按CTRL+S存档!!!
记得要按CTRL+S存档!!!
下一章节会介绍Unity的Asset Store和从Asset Store或网路下载3D模型。


<<:  [Day 5]从零开始学习 JS 的连续-30 Days---比较与逻辑运算子

>>:  使用 Line Messaging Api 取得 User Profile

Day 28 Explore monitoring and reporting

Compare authentication and authorization Authentic...

Day 18 Rails MVC

What is MVC? 先招唤 wiki 大大出来解释一下 MVC 是甚麽: MVC模式(Mode...

【在厨房想30天的演算法】Day 06 资料结构:连结串列 Linked List

Aloha!又是我少女人妻 Uerica ,今天中秋节大家吃肉了吗!传说中后羿的狗狗偷吃了嫦娥吃剩的...

Day 12 - UML — 系统设计不可不知的 UML

今天再度要进入新的篇章啦!!! 身为软件工程师,想要设计出好的系统架构,或是综观地去理解系统的话,...

【Day 17】从二开始的 Anti-Anti-Debug 生活 - Anti-Anti-Debug

环境 Windows 10 21H1 x64dbg Aug 2 2020, 13:56:14 Vis...