Log in or register to post comments

How to use Unity scripts in Android project?

October 16, 2016 - 10:53pm #1

I'd appreciate if someone could advise on my problem.

I have a Unity AR project, which simply contains one Image target with a 3D object placed on it. My goal was to implement some behavior when image target gets detected (show some UI for example).

I got a C# script for my ImageTarget that works fine:

 

public class ImageTargetTrack : MonoBehaviour,  ITrackableEventHandler {

    //class implementation..

    public void OnTrackableStateChanged(

                                    TrackableBehaviour.Status previousStatus,

                                    TrackableBehaviour.Status newStatus)

    {

        if (newStatus == TrackableBehaviour.Status.DETECTED ||

            newStatus == TrackableBehaviour.Status.TRACKED ||

            newStatus == TrackableBehaviour.Status.EXTENDED_TRACKED)

        {

            // show create button        

        }

        else

        {

            // hide create button         

        }

    }

}

 

Now, I'd like to understand, is it possible to implement the same code in Android project, which was exported by Unity (and not using Vuforia SDK for Android)? In short, I want to integrate  Android UI with Unity by showing/hiding Android button.

 

Thank you in advance.

 

 

Log in or register to post comments