Associating markers with planets

To associate markers with planet views, we need to write our own marker handler script. We will build this script incrementally, so it's easy to see what is going on.

First, we'll write in the code to register our callback function to VuMark Manager. This is a standard pattern in Unity C# for handling events:

  1. In Hierarchy, select GameController and go to Add Component | New Script; name it PlanetMarkerHandler.

Open the script in your editor and write it as follows:

File: PlanetMarkerHandler.cs using System.Collections; using System.Collections.Generic; using UnityEngine; using Vuforia; public class PlanetMarkerHandler : MonoBehaviour { private VuMarkManager mVuMarkManager; void Start () { // register callbacks ...

Get Augmented Reality for Developers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.