Building the app's Main-mode
As you now know, AR Tracked Image Manager (on the AR Session Origin game object) performs 2D image tracking. But so far, we've being using the AR Tracked Image Manager incorrectly! We populated its Tracked Image Prefab property with our Earth Prefab. That's a no-no. According to the Unity documentation, "ARTrackedImageManager
has a "Tracked Image Prefab" field; however, this is not intended for content" (https://docs.unity3d.com/Packages/com.unity.xr.arfoundation@4.2/manual/tracked-image-manager.html). Currently, when any reference image is recognized, the Earth Prefab will always be instantiated.
Rather, when the app is in Main-mode, we should determine which planet card image is being tracked and instantiate the corresponding planet prefab for that card. So far, we only have one planet, Earth, in the image reference library. However, later in this chapter, we'll expand the project for all the planets. We can...