Unity ARKit development process

        First of all, the new ARKit is no longer developed using the ARKit plug-in package alone, but through ARFoundation, ARKit or ARCore. ARFoundation can be said to be a new unified API interface developed by unity for AR. It unifies the ARKit and ARCore interfaces. Encapsulation, you don’t need to develop twice if you change the platform in the future, because the API interface is the same, you only need to switch the platform in the engine and compile it. The following are the required development tools and the versions I use:

Unity version: 2019.3.4f1

ARFoundation:2.1.4

ARKit XR Plugin:2.1.2

ARKit Face Tracking:1.0.2

Xcode:11.4

 

1. Plug-in import

Select menuWindow-package manager

2. Set up the development environment

First switch the development platform to ios, and then set the company name and developer name in Player Setting, as shown below:

Next, fill in the corresponding program ID and version number in "Other Setting"

Continue to pull down and fill in the request information for using the camera, which will request the user to use the camera when the AR application starts for the first time. After setting the Target Device, the target device can be iPhone, iPad, or iPhone+iPad at the same time. Because we use a real device for application debugging, we set the Target SDK to Device SDK. Set the minimum iOS system version to 11.0, because the minimum iOS version that supports ARKit is 11.0. Finally, set the processor architecture to ARM64.

3. Build the basic framework

After completing the above steps, let's build a basic application framework, which is common to all AR applications and let our programs run.

Create a new project, we create a scene named 'Hello ARKit', delete the original camera of the scene, then click the right mouse button on the blank space in the Hierarchy window, and select XR->AR Session and XR–>AR Session Origin, create these two basic AR components.

Create a new Cube, make it a preset, place it in the Assets-Prefabs folder, then add the AR Plane Manager component under AR Session Origin, and drag the Cube preset to the "Plane Prefab" option, as shown in the figure :

So far, we have built the basic framework of AR applications. This is a basic framework for ARFoundation to develop iOS AR applications, and the process is common. And by comparing the previous article, we can find that in terms of basic framework construction, Android development is completely consistent with iOS development. We will also see later that the code written is also completely consistent. This is the meaning of ARFoundation, that is, to develop multiple platforms at once. For deployment, except for the different environment configurations, other objects and code writing are the same, which saves developers the trouble of developing AR applications on different platforms.
Finally, I recommend the blog of an industry leader. His blog is very detailed. I also learned a lot from his blog. I would like to express my gratitude! Attach his blog address below: https://blog.csdn.net/yolon3000/article/details/93405795

Guess you like

Origin blog.csdn.net/Abel02/article/details/105291968