Пример #1
0
    public void OnNewSearchResult(TargetFinder.TargetSearchResult targetSearchResult)
    {
        message.text = "Target Search Result: " + targetSearchResult.TargetName;
        TargetFinder.CloudRecoSearchResult cloudRecoResult = (TargetFinder.CloudRecoSearchResult)targetSearchResult;

        // Build augmentation based on target
        if (ImageTargetTemplate)
        {
            // enable the new result with the same ImageTargetBehaviour:
            ObjectTracker tracker = TrackerManager.Instance.GetTracker <ObjectTracker>();
            tracker.GetTargetFinder <ImageTargetFinder>().ClearTrackables(false);
            tracker.GetTargetFinder <ImageTargetFinder>().EnableTracking(targetSearchResult, ImageTargetTemplate.gameObject);
        }

        if (cloudRecoResult.MetaData == null)
        {
            message2.text = "No Meta Data";
        }
        else
        {
            message2.text = "MetaData: " + cloudRecoResult.MetaData +
                            "\nTargetName: " + cloudRecoResult.TargetName;
            webRequestHandler.RequestAssetBundle(cloudRecoResult.MetaData);
        }
    }