ARCore — Build Android with Unity ,HelloAR

JLin
JLin
Sep 8, 2018 · 5 min read

如果要單純的放入3DObject 進行移動或者顯示,可以使用Android的ARCore SDK 並且透過java or kotlin曾加入基本互動,可是如果今天想要做一個有場景的動畫呢?

必須透過一個3D動畫的Framework在達到這件事情,因此可以考慮使用Unity,因為Unity有一個Google ARCore SDK for unity,可以再Unity中增加AR的功能,而遊戲場景又是Unity的強項,所以在Unity上進行建置的話似乎才是一個比較好的解法

但Unity需要了解操作方式,還有3D動畫的製作,才能作出在Android手機上顯示的功能

  1. 先下載 Unity -Editor,並且安裝

2.下載一包ARCore SDK for unity & example

3.安裝好後應該可以看到下方的Project Assets會出現ARCORE,就代表安裝成功

5.進入設定Build的屬性設定

File->Build Setting

Platform選Android進行設定,會需要你下載Android的tool並且進行安裝,記得裝好後把unity關掉重開,之後就會出現Android的屬性,接著再按下Build的時候會要求你設定基本的設定,也就是Android Project的設定值

重點:注意上方的Scenes in Build

要選擇GoogleArCore/..HelloAR那個選項,否則他不會啟動

左下方的Player Setting後會出現在右邊,

要進行設定minSdk and target都是7.0

另外記得下方的ARCore要開啟

成果如下

主要就是自己對於ARCore官方網站寫得沒有很清楚,實際實作的紀錄囉

有步驟不清楚的可以發問我再補上

p.s

在這邊有說明

可以把Texture compresssion 改為ETC2

這邊有把project export為一個native的android project並且build為aar使用

JLin

Written by

JLin

share about Photography(360 / DSLR / DC / Mobile) , Programer (Android / Javascript / Code) , 3C Product @ Taipei,Taiwan

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade