/// <summary> /// This method only demonstrates how to handle extended tracking feature when you have multiple targets in the scene /// So, this method could be removed otherwise /// </summary> private void StopExtendedTracking() { // If Extended Tracking is enabled, we first disable it for all the trackables // and then enable it only for the newly created target bool extTrackingEnabled = mTrackableSettings && mTrackableSettings.IsExtendedTrackingEnabled(); if (extTrackingEnabled) { StateManager stateManager = TrackerManager.Instance.GetStateManager(); // 1. Stop extended tracking on all the trackables foreach (var tb in stateManager.GetTrackableBehaviours()) { var itb = tb as ImageTargetBehaviour; if (itb != null) { itb.ImageTarget.StopExtendedTracking(); } } // 2. Start Extended Tracking on the most recently added target List <TrackableBehaviour> trackableList = stateManager.GetTrackableBehaviours().ToList(); ImageTargetBehaviour lastItb = trackableList [LastTargetIndex] as ImageTargetBehaviour; if (lastItb != null) { if (lastItb.ImageTarget.StartExtendedTracking()) { Debug.Log("Extended Tracking successfully enabled for " + lastItb.name); } } } }