[Unity] ARCore CloudAnchors

문연수·2022년 8월 8일
0

Unity

목록 보기
1/1
post-thumbnail

0. Prerequisites

 Before we start the ARCore CloudAnchors, under processes will be done:

  1. Download JDK to use keytool
  2. Register Google Cloud Platform
  3. Download arcore-unity-extensions package from the google-ar official github.

1. Start with a new Project.

- Environments

Create a new Project Templated by AR (Core).

  • Unity Hub Version: 3.2.0
  • Editor Version: 2021.3.6f1 (LTS)

- Import package

  1. Importing the package that was downloaded from 0. Prerequisites
    • Windows > Package Manager > + Add package from disk... > package.json
  2. Import a sample Persistent Cloud Anchor Sample

- Project Settings

* Player

  • Other Settings > Set the Target API Level to API Level 32
  • Set the Package Name to what you want.

Publishing Settings > Keystore Manager... > Create New


* XR Plug-in Management

Plug-in Providers > Check ARCore

ARCore Extensions / Android Authentication Strategy > Change Keyless (Recommanded)
Optional Features > Check Cloud Anchors

2. Create GCP API Key

- Create a new GCP Project

- Enable ARCore Cloud Anchor API

Click the button to use ARCore Cloud Anchor API.

- Create API Key

Create a new API Key.

And set the API Restriction to ARCore Cloud Anchor API, then Save.

3. Link with GCP OAuth Client ID

- Find SHA-1 Fingerprint from keystore

cd <Java/JDK/bin/>
.\keytool.exe -list -v -keystore <your keystore path>
Enter keystore password: <your password>

 Backup SHA-1 Certificate fingerprint.

- Create new OAuth Client ID

Create OAuth Client ID

  • Package name in Project Settings
  • SHA-1 Certificate fingerprint in keystore

And then Save.

3. Build Project

- Open Sample Scene

PersistentCloudAnchors.unity Scene in Assets/Samples

- Build Settings

  • Add Open Scenes
  • Switch platform to Android
  • Build And Run

4. Run

- References

[Link] https://developers.google.com/ar/develop/unity-arf/cloud-anchors/developer-guide-android
[Link] https://www.oracle.com/java/technologies/downloads/
[Link] https://github.com/google-ar/arcore-unity-extensions

profile
2000.11.30

0개의 댓글