void Update() { if (m_CloudRecoBehaviour.CloudRecoInitialized) { SetCloudActivityIconVisible(m_ObjectTracker.GetTargetFinder <TargetFinder>().IsRequesting()); } }
protected override void OnTrackingLost() { Debug.Log("<color=blue>OnTrackingLost()</color>"); base.OnTrackingLost(); if (m_CloudRecoContentManager) { m_CloudRecoContentManager.ShowTargetInfo(false); } // Start finder again if we lost the current trackable ObjectTracker objectTracker = TrackerManager.Instance.GetTracker <ObjectTracker>(); if (objectTracker != null) { objectTracker.GetTargetFinder <TargetFinder>().ClearTrackables(false); objectTracker.GetTargetFinder <TargetFinder>().StartRecognition(); if (m_ScanLine) { // Start showing the scan-line m_ScanLine.ShowScanLine(true); } } }
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); } }
// Here we handle a cloud target recognition event public void OnNewSearchResult(TargetFinder.TargetSearchResult targetSearchResult) { Debug.Log("New Search Result Found!"); mTargetName = targetSearchResult.TargetName; Debug.Log("Target: " + mTargetName); TargetFinder.CloudRecoSearchResult cloudRecoSearchResult = (TargetFinder.CloudRecoSearchResult)targetSearchResult; // do something with the target metadata mTargetMetadata = cloudRecoSearchResult.MetaData; if (mTargetMetadata != null) { Debug.Log("Cloud Search Metadata: " + mTargetMetadata); } else { Debug.Log("No Cloud Search Metadata"); } // stop the target finder (i.e. stop scanning the cloud) mCloudRecoBehaviour.CloudRecoEnabled = false; // Build augmentation based on target if (ImageTargetTemplate) { // enable the new result with the same ImageTargetBehaviour: ObjectTracker tracker = TrackerManager.Instance.GetTracker <ObjectTracker>(); tracker.GetTargetFinder <ImageTargetFinder>().EnableTracking(targetSearchResult, ImageTargetTemplate.gameObject); } uIHandler.updateTarget(mTargetName); }
public void OnNewSearchResult(TargetFinder.TargetSearchResult targetSearchResult) { TargetFinder.CloudRecoSearchResult cloudRecoSearchResult = (TargetFinder.CloudRecoSearchResult)targetSearchResult; mIsScanning = false; mTargetMetadata = cloudRecoSearchResult.MetaData; Debug.Log(mTargetMetadata); //GameObject newImageTarget = Instantiate(targetBehaviour.gameObject) as GameObject; //MainVideoPlayer = newImageTarget.transform.GetChild(0).gameObject; //metadata = newImageTarget.transform.GetChild(1).gameObject; //Debug.Log(newImageTarget.transform.GetChild(1).transform.GetChild(0)); //GameObject augmentation = null; //if (augmentation != null) //{ // augmentation.transform.SetParent(newImageTarget.transform); // Debug.Log("Augmentation is " + augmentation.name); //} if (targetBehaviour) { ObjectTracker tracker = TrackerManager.Instance.GetTracker <ObjectTracker>(); ImageTargetBehaviour imageTargetBehaviour = (ImageTargetBehaviour)tracker.GetTargetFinder <ImageTargetFinder>().EnableTracking(targetSearchResult, targetBehaviour.gameObject); } //MainVideoPlayer.GetComponent<VideoPlayer>().url = mTargetMetadata.Trim(); //appManager.LoadAR(mTargetMetadata.Trim()); stringParser.SplitString(mTargetMetadata.Trim()); //metadata.GetComponentInChildren<Text>().text = mTargetMetadata; if (!mIsScanning) { mCloudRecoBehaviour.CloudRecoEnabled = true; } }
// Here we handle a cloud target recognition event public void OnNewSearchResult(TargetFinder.TargetSearchResult targetSearchResult) { TargetFinder.CloudRecoSearchResult cloudRecoSearchResult = (TargetFinder.CloudRecoSearchResult)targetSearchResult; // do something with the target metadata mTargetMetadata = cloudRecoSearchResult.MetaData; // stop the target finder (i.e. stop scanning the cloud) mCloudRecoBehaviour.CloudRecoEnabled = false; if (ImageTargetTemplate) { isfound = true; // enable the new result with the same ImageTargetBehaviour: ObjectTracker tracker = TrackerManager.Instance.GetTracker <ObjectTracker>(); tracker.GetTargetFinder <ImageTargetFinder>().EnableTracking(targetSearchResult, ImageTargetTemplate.gameObject); RText.text = obj.retriveList[targetSearchResult.TargetName][0]; Debug.Log("s c h : " + RText.text); check(targetSearchResult.TargetName); } }
// Here we handle a cloud target recognition event public void OnNewSearchResult(TargetFinder.TargetSearchResult targetSearchResult) { TargetFinder.CloudRecoSearchResult cloudRecoSearchResult = (TargetFinder.CloudRecoSearchResult)targetSearchResult; // do something with the target metadata mTargetMetadata = cloudRecoSearchResult.MetaData; // stop the target finder (i.e. stop scanning the cloud) mCloudRecoBehaviour.CloudRecoEnabled = false; // Build augmentation based on target if (ImageTargetTemplate) { // enable the new result with the same ImageTargetBehaviour: ObjectTracker tracker = TrackerManager.Instance.GetTracker <ObjectTracker>(); tracker.GetTargetFinder <ImageTargetFinder>().EnableTracking(targetSearchResult, ImageTargetTemplate.gameObject); } movie = JsonUtility.FromJson <Movie>(mTargetMetadata); mTargetMetadata = movie.name; URL = movie.url; SetActivityInNativePlugin(); //ShowTargetInfo(mTargetMetadata); MovieTTS(mTargetMetadata); string date = DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss"); AddHistoryEntry(date, movie.name); bool fav = CheckIfFav(date, movie.name); favoritesSwap.SetFavorite(fav); }
/// <summary> /// called when TargetFinder has been initialized successfully /// </summary> public void OnInitialized() { Debug.Log("Cloud Reco initialized successfully."); m_ObjectTracker = TrackerManager.Instance.GetTracker <ObjectTracker>(); m_TargetFinder = m_ObjectTracker.GetTargetFinder <ImageTargetFinder>(); }
protected override void OnTrackingFound() { Debug.Log("<color=blue>OnTrackingFound()</color>"); base.OnTrackingFound(); if (m_CloudRecoContentManager) { m_CloudRecoContentManager.ShowTargetInfo(true); } // Stop finder since we have now a result, finder will be restarted again when we lose track of the result ObjectTracker objectTracker = TrackerManager.Instance.GetTracker <ObjectTracker>(); if (objectTracker != null) { objectTracker.GetTargetFinder <TargetFinder>().Stop(); if (m_ScanLine) { // Stop showing the scan-line m_ScanLine.ShowScanLine(false); } } }
public void OnStateChanged(bool scanning) { mIsScanning = scanning; if (scanning) { ObjectTracker tracker = TrackerManager.Instance.GetTracker <ObjectTracker>(); tracker.GetTargetFinder <ImageTargetFinder>().ClearTrackables(false); } }
public void OnStateChanged(bool scanning) { Debug.Log("<color=blue>OnStateChanged(): </color>" + scanning); mIsScanning = scanning; Debug.Log("<color=blue>mScanning: </color>" + mIsScanning); if (scanning) { ObjectTracker tracker = TrackerManager.Instance.GetTracker <ObjectTracker>(); tracker.GetTargetFinder <ImageTargetFinder>().ClearTrackables(false); } }
// Here we handle a cloud target recognition event public void OnNewSearchResult(TargetFinder.TargetSearchResult targetSearchResult) { TargetFinder.CloudRecoSearchResult cloudRecoSearchResult = (TargetFinder.CloudRecoSearchResult)targetSearchResult; // do something with the target metadata mTargetMetadata = cloudRecoSearchResult.MetaData; if ((mTargetMetadata == "alcohol")) { if (ImageTargetTemplate_Alcohol) { // enable the new result with the same ImageTargetBehaviour: ObjectTracker tracker = TrackerManager.Instance.GetTracker <ObjectTracker>(); tracker.GetTargetFinder <ImageTargetFinder>().EnableTracking(targetSearchResult, ImageTargetTemplate_Alcohol.gameObject); } Debug.Log(mTargetMetadata); } else if ((mTargetMetadata == "levepromazina")) { if (ImageTargetTemplate_Levepromazina) { // enable the new result with the same ImageTargetBehaviour: ObjectTracker tracker = TrackerManager.Instance.GetTracker <ObjectTracker>(); tracker.GetTargetFinder <ImageTargetFinder>().EnableTracking(targetSearchResult, ImageTargetTemplate_Levepromazina.gameObject); } Debug.Log(mTargetMetadata); } else if ((mTargetMetadata == "albendazol")) { if (ImageTargetTemplate_Albendazol) { // enable the new result with the same ImageTargetBehaviour: ObjectTracker tracker = TrackerManager.Instance.GetTracker <ObjectTracker>(); tracker.GetTargetFinder <ImageTargetFinder>().EnableTracking(targetSearchResult, ImageTargetTemplate_Albendazol.gameObject); } Debug.Log(mTargetMetadata); } else if ((mTargetMetadata == "metoclopramida")) { if (ImageTargetTemplate_Metoclopramida) { // enable the new result with the same ImageTargetBehaviour: ObjectTracker tracker = TrackerManager.Instance.GetTracker <ObjectTracker>(); tracker.GetTargetFinder <ImageTargetFinder>().EnableTracking(targetSearchResult, ImageTargetTemplate_Metoclopramida.gameObject); } Debug.Log(mTargetMetadata); } // stop the target finder (i.e. stop scanning the cloud) mCloudRecoBehaviour.CloudRecoEnabled = false; }
public void OnNewSearchResult(TargetFinder.TargetSearchResult targetSearchResult) { TargetFinder.CloudRecoSearchResult cloudRecoSearchResult = (TargetFinder.CloudRecoSearchResult)targetSearchResult; mIsScanning = false; mTargetMetadata = cloudRecoSearchResult.MetaData; Debug.Log(mTargetMetadata); if (targetBehaviour) { ObjectTracker tracker = TrackerManager.Instance.GetTracker <ObjectTracker>(); ImageTargetBehaviour imageTargetBehaviour = (ImageTargetBehaviour)tracker.GetTargetFinder <TargetFinder>().EnableTracking(targetSearchResult, targetBehaviour.gameObject); } parser.SplitMeta(mTargetMetadata); }
public void OnNewSearchResult(TargetFinder.TargetSearchResult targetSearchResult) { TargetFinder.CloudRecoSearchResult cloudRecoSearchResult = (TargetFinder.CloudRecoSearchResult)targetSearchResult; mTargetData = cloudRecoSearchResult.MetaData; this.cloudRecoBehaviour.CloudRecoEnabled = false; if (this.ImageTargetTemplate) { ObjectTracker tracker = TrackerManager.Instance.GetTracker <ObjectTracker>(); tracker.GetTargetFinder <ImageTargetFinder>().EnableTracking(targetSearchResult, ImageTargetTemplate.gameObject); } else { } }
public void OnNewSearchResult(TargetFinder.TargetSearchResult targetSearchResult) { TargetFinder.CloudRecoSearchResult cloudRecoSearchResult = (TargetFinder.CloudRecoSearchResult)targetSearchResult; // doing the task with the target metadata mTargetMetadata = cloudRecoSearchResult.MetaData; // stopping the target finder (i.e. stop scanning the cloud) mCloudRecoBehaviour.CloudRecoEnabled = false; if (ImageTargetTemplate) { // enabling the new result with the same ImageTargetBehaviour: ObjectTracker tracker = TrackerManager.Instance.GetTracker <ObjectTracker>(); tracker.GetTargetFinder <ImageTargetFinder>().EnableTracking(targetSearchResult, ImageTargetTemplate.gameObject); } }
// Here we handle a cloud target recognition event public void OnNewSearchResult(TargetFinder.TargetSearchResult targetSearchResult) { // do something with the target metadata mTargetMetadata = targetSearchResult.MetaData; // stop the target finder (i.e. stop scanning the cloud) mCloudRecoBehaviour.CloudRecoEnabled = false; // Build augmentation based on target if (ImageTargetTemplate) { // enable the new result with the same ImageTargetBehaviour: ObjectTracker tracker = TrackerManager.Instance.GetTracker <ObjectTracker>(); ImageTargetBehaviour imageTargetBehaviour = (ImageTargetBehaviour)tracker.GetTargetFinder <TargetFinder>().EnableTracking( targetSearchResult, ImageTargetTemplate.gameObject); } }
/// <summary> /// Handles new search results /// </summary> /// <param name="targetSearchResult"></param> public void OnNewSearchResult(TargetFinder.TargetSearchResult targetSearchResult) { TargetFinder.CloudRecoSearchResult cloudRecoSearchResult = (TargetFinder.CloudRecoSearchResult)targetSearchResult; // duplicate the referenced image target newImageTarget = Instantiate(ImageTargetTemplate.gameObject) as GameObject; GameObject augmentation = null; if (augmentation != null) { augmentation.transform.parent = newImageTarget.transform; } // enable the new result with the same ImageTargetBehaviour: ImageTargetBehaviour = (ImageTargetBehaviour)mImageTracker.GetTargetFinder <ImageTargetFinder>().EnableTracking(targetSearchResult, newImageTarget); mTargetName = cloudRecoSearchResult.TargetName; mTargetMetadata = cloudRecoSearchResult.MetaData; for (int i = 0; i < ImageTargetBehaviour.gameObject.transform.childCount; i++) { if (ImageTargetBehaviour.gameObject.transform.GetChild(i).gameObject.name != mTargetName) { ImageTargetBehaviour.gameObject.transform.GetChild(i).gameObject.SetActive(false); } } for (int i = 0; i < SoundObjects.Length; i++) { if (SoundObjects[i].targetName == mTargetName) { audioSource.clip = SoundObjects[i].sound; } } SetInfo(); if (!mIsScanning) { // stop the target finder mCloudRecoBehaviour.CloudRecoEnabled = true; } }
public void OnNewSearchResult(TargetFinder.TargetSearchResult targetSearchResult) { TargetFinder.CloudRecoSearchResult cloudRecoSearchResult = (TargetFinder.CloudRecoSearchResult)targetSearchResult; // do something with the target metadata mTargetMetadata = cloudRecoSearchResult.MetaData; Debug.Log("URL: " + mTargetMetadata); // Build augmentation based on target if (ImageTargetTemplate) { // enable the new result with the same ImageTargetBehaviour: ObjectTracker tracker = TrackerManager.Instance.GetTracker <ObjectTracker>(); tracker.GetTargetFinder <ImageTargetFinder>().EnableTracking(targetSearchResult, ImageTargetTemplate.gameObject); MainPlayer.GetComponent <VideoPlayer>().url = mTargetMetadata.Trim(); MainPlayer.GetComponent <VideoPlayer>().Play(); } // stop the target finder (i.e. stop scanning the cloud) mCloudRecoBehaviour.CloudRecoEnabled = false; }
//FONCTION DE RECHERCHE DE L'IMAGE TARGET DANS LE VUFORIA CLOUD// public void OnNewSearchResult(TargetFinder.TargetSearchResult targetSearchResult) { TargetFinder.CloudRecoSearchResult cloudResult = (TargetFinder.CloudRecoSearchResult)targetSearchResult; // 2018.4 mTargetMetadata = cloudResult.MetaData; mcloudRecoBehaviour.CloudRecoEnabled = false; if (!mIsScanning) { Debug.Log("SCAN START"); mcloudRecoBehaviour.CloudRecoEnabled = true; jsonManager.readData = true; // Active le boolean pour lire la coroutine une seule fois pour mapper les datas } if (ImageTargetTemplate) { ObjectTracker tracker = TrackerManager.Instance.GetTracker <ObjectTracker>(); tracker.GetTargetFinder <ImageTargetFinder>().EnableTracking(targetSearchResult, ImageTargetTemplate.gameObject); } }
// Here we handle a cloud target recognition event - vuforia function I have changed public void OnNewSearchResult(TargetFinder.TargetSearchResult targetSearchResult) { //vuforia stuff TargetFinder.CloudRecoSearchResult cloudRecoSearchResult = (TargetFinder.CloudRecoSearchResult)targetSearchResult; // keeps the metafata of the target mTargetMetadata = cloudRecoSearchResult.MetaData; // splits the metadata to url and size string[] splitArray = mTargetMetadata.Split(char.Parse(" ")); string url = splitArray[0]; sizeType = splitArray[1]; if (splitArray[0] == "url" && splitArray[1] == "url") { websiteURL = splitArray[2]; Application.OpenURL(websiteURL); enabledButton(true); // button X dissapears mTargetMetadata = null; // deleate the metadate vim.GetComponent <Vimeo.Player.VimeoPlayer>().Pause(); // stops playing vimeo video mCloudRecoBehaviour.CloudRecoEnabled = true; //vuforia stuff hideVimScreenWhenVimIsNotReady(); //hides vimeo screen instance.IsPlaying = false; instance.StopAnim(); IntroButton.SetActive(true); } if (splitArray.Length > 2) { websiteURL = splitArray[2]; if (splitArray.Length > 3) { firstWord = splitArray[3]; secondWord = splitArray[4]; GotoWebText.text = $"{firstWord} {secondWord}"; //changeGoToText(goToText); } } else { websiteURL = null; } //sends the size . for update vimeo screen size changeSize(sizeType); if (websiteURL != null) { GoWebsiteBtn.SetActive(true); } else { GoWebsiteBtn.SetActive(false); } // stop the target finder (i.e. stop scanning the cloud) -vuforia stuff mCloudRecoBehaviour.CloudRecoEnabled = false; // Build augmentation based on target - vuforia stuff if (ImageTargetTemplate) { ObjectTracker tracker = TrackerManager.Instance.GetTracker <ObjectTracker>(); tracker.GetTargetFinder <ImageTargetFinder>().EnableTracking(targetSearchResult, ImageTargetTemplate.gameObject); } //printing in the debug it starts to play print("was told to Play &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&"); //enable the vimeo screen so we can see it vim.SetActive(true); //tells the vimeo to start to play if (splitArray[0] == "url") { return; } else { vim.GetComponent <Vimeo.Player.VimeoPlayer>().LoadVideo(url); vim.GetComponent <Vimeo.Player.VimeoPlayer>().PlayVideo(url); } print("here"); print(websiteURL); instance.IsPlaying = true; instance.StopAnim(); IntroButton.SetActive(false); }
// Here we handle a cloud target recognition event public void OnNewSearchResult(TargetFinder.TargetSearchResult targetSearchResult) { TargetFinder.CloudRecoSearchResult cloudRecoSearchResult = (TargetFinder.CloudRecoSearchResult)targetSearchResult; // do something with the target name // mTargetName = cloudRecoSearchResult.TargetName; mTargetName = targetSearchResult.TargetName; // stop the target finder (i.e. stop scanning the cloud) mCloudRecoBehaviour.CloudRecoEnabled = false; Debug.Log("Name target :" + mTargetName); //statement untuk menampilkan objek 3d berdasarkan target name if (mTargetName == "gedung_rektorat") { gedung_rektorat.SetActive(true); kantin_baru.SetActive(false); entrance_hall.SetActive(false); gedung_9.SetActive(false); gedung_7.SetActive(false); studio.SetActive(false); kantor_satpam.SetActive(false); } else if (mTargetName == "kantin_baru") { gedung_rektorat.SetActive(false); kantin_baru.SetActive(true); entrance_hall.SetActive(false); gedung_9.SetActive(false); gedung_7.SetActive(false); studio.SetActive(false); kantor_satpam.SetActive(false); } else if (mTargetName == "entrance_hall") { gedung_rektorat.SetActive(false); kantin_baru.SetActive(false); entrance_hall.SetActive(true); gedung_9.SetActive(false); gedung_7.SetActive(false); studio.SetActive(false); kantor_satpam.SetActive(false); } else if (mTargetName == "gedung_9") { gedung_rektorat.SetActive(false); kantin_baru.SetActive(false); entrance_hall.SetActive(false); gedung_9.SetActive(true); gedung_7.SetActive(false); studio.SetActive(false); kantor_satpam.SetActive(false); } else if (mTargetName == "gedung_7") { gedung_rektorat.SetActive(false); kantin_baru.SetActive(false); entrance_hall.SetActive(false); gedung_9.SetActive(false); gedung_7.SetActive(true); studio.SetActive(false); kantor_satpam.SetActive(false); } else if (mTargetName == "studio") { gedung_rektorat.SetActive(false); kantin_baru.SetActive(false); entrance_hall.SetActive(false); gedung_9.SetActive(false); gedung_7.SetActive(false); studio.SetActive(true); kantor_satpam.SetActive(false); } if (imageTargetBehaviour) { // enable the new result with the same ImageTargetBehaviour: ObjectTracker tracker = TrackerManager.Instance.GetTracker <ObjectTracker>(); // (imageTargetBehaviour)tracker.TargetFinder.EnableTracking(targetSearchResult, imageTargetBehaviour.gameObject); tracker.GetTargetFinder <ImageTargetFinder>().EnableTracking(targetSearchResult, imageTargetBehaviour.gameObject); } }
public void OnNewSearchResult(TargetFinder.TargetSearchResult targetSearchResult) { GameObject newImageTarget = Instantiate(ImageTargetTemplate.gameObject) as GameObject; GameObject augmentation = null; if (augmentation != null) { augmentation.transform.SetParent(newImageTarget.transform); } if (ImageTargetTemplate) { ObjectTracker tracker = TrackerManager.Instance.GetTracker <ObjectTracker>(); ImageTargetBehaviour imageTargetBehaviour = (ImageTargetBehaviour)tracker.GetTargetFinder <ImageTargetFinder>().EnableTracking(targetSearchResult, newImageTarget); } if (!mIsScanning) { mCloudRecoBehaviour.CloudRecoEnabled = true; } TargetFinder.CloudRecoSearchResult cloudRecoSearchResult = (TargetFinder.CloudRecoSearchResult)targetSearchResult; string mTargetId = cloudRecoSearchResult.UniqueTargetId; Poster p = new Poster(); p.targetid = mTargetId; posterSessionId.posterId = mTargetId; p.GetPoster(); newImageTarget.GetComponent <CustomImageTargetBehaviour>().setPoster(p); if (mTargetId.Equals("13b49fe524904e80ad087ea3e8d95cea")) { YANObject.SetActive(true); YANObject.transform.parent = newImageTarget.transform; YANObject.transform.localPosition = new Vector3(0f, 0, 0); return; } if (p.type == 2) // 2 is graph type { Option opt = new Option(); opt.targetid = mTargetId; opt.GetOptions(); GameObject gmGraph = OnNewSearchGraph(); foreach (Option op in opt.options) { Material mat = new Material(Shader.Find("Standard")); float r = Random.Range(0f, 1f); float g = Random.Range(0f, 1f); float b = Random.Range(0f, 1f); float a = 0.9f; mat.SetVector("_Color", new Color(r, g, b, a)); mat.SetFloat("_Glossiness", 1.0f); //mat.SetVector("_ColorTo", Color.yellow); gmGraph.GetComponent <BarChartFeed>().setBars(op.value, op.key, mat); } gmGraph.transform.parent = newImageTarget.transform; gmGraph.transform.localPosition = new Vector3(-2f, -5, -1); gmGraph.transform.localScale = new Vector3(0.5f, 0.5f, 0.5f); return; } StartCoroutine(DownloadAndCache(p, newImageTarget)); }