Log in or register to post comments

Metadata Unity

April 22, 2013 - 6:56am #1

Hi,

Can anyone tell me how to retrieve the metadata string in Unity using C#.

Thanks.

Amine.

Metadata Unity

October 15, 2013 - 10:34am #12

Yes. The easiest approach will probably be to pass the metadata to your script by referencing it using GetComponent() in the event handler. Otherwise rewriting the event handler in Javascript would require you to restructure the project to ensure the proper compilation order for the C# references.

See: http://docs.unity3d.com/Documentation/Manual/Scripting42.html

Metadata Unity

October 15, 2013 - 9:58am #11

Can i use Unity javaScript to access MetaData?

Metadata Unity

August 27, 2013 - 12:57am #10

Here you can find all  http://csharp.net-informations.com/string/csharp_string_tutorial.htm C# string operations..

steve

 

Metadata Unity

May 6, 2013 - 3:54am #9

Hi, concerning metadata, have you checked this post:

https://developer.vuforia.com/forum/ar-technical-discussion/cloud-recognition

 

Metadata Unity

May 5, 2013 - 10:55pm #8

Hi All,

what is metadata here, just i uploaded image target in a cloud dabase and strucked with metadata . What is this metadata ? how can i create metadata to upload in a cloud databse ? 

 

Thanks in advance. please share your ideas to resolve my problem.

Metadata Unity

April 22, 2013 - 9:21am #7

Thank you very much.

It works now.

Metadata Unity

April 22, 2013 - 8:53am #6

Like I said below:

targetSearchResult.MetaData

gives you the metadata

If you output this using Debug.Log for the sample it should show something like samplebook1.json which is the content of the metadata file pertaining to that target.

 

N

Metadata Unity

April 22, 2013 - 8:05am #5

Adding string is not the problem.

The problem is how to grab the string from the metadata and store it in a string variable.

Metadata Unity

April 22, 2013 - 7:54am #4

It seems you need to figure out how to add strings in c#

A simple web search of  "unity3d add string c#" reveals the following:

http://www.dotnetperls.com/string-append

 

N

Metadata Unity

April 22, 2013 - 7:21am #3

Thanks NalinS,

I have a string variable called url_path, I want to change it to : url_path = "My url"+"metadata string";

How can I do it.

Thanks.

Metadata Unity

April 22, 2013 - 7:12am #2

Check the source and you will find references to metadata in the callback below.

CloudRecoEventHandler.cs

 

 

    /// <summary>

    /// Handles new search results

    /// </summary>

    /// <param name="targetSearchResult"></param>

    public void OnNewSearchResult(TargetFinder.TargetSearchResult targetSearchResult)

    {

        // This code demonstrates how to reuse an ImageTargetBehaviour for new search results and modifying it according to the metadata

        // Depending on your application, it can make more sense to duplicate the ImageTargetBehaviour using Instantiate(), 

        // or to create a new ImageTargetBehaviour for each new result

 

        // Vuforia will return a new object with the right script automatically if you use

        // TargetFinder.EnableTracking(TargetSearchResult result, string gameObjectName)

        

        //Check if the metadata isn't null

        if(targetSearchResult.MetaData == null)

        {

            return;

        }

 

        // enable the new result with the same ImageTargetBehaviour:

        ImageTargetBehaviour imageTargetBehaviour = mImageTracker.TargetFinder.EnableTracking(targetSearchResult, mParentOfImageTargetTemplate);

 

        if (imageTargetBehaviour != null)

        {

            // stop the target finder

            mCloudRecoBehaviour.CloudRecoEnabled = false;

            

            // Calls the TargetCreated Method of the SceneManager object to start loading

            // the BookData from the JSON

            mContentManager.TargetCreated(targetSearchResult.MetaData);

        }

    }

 

 

 

Log in or register to post comments