Log in or register to post comments

Trigger onGUI when ImageTarget loads

November 4, 2011 - 12:21pm #1

I have multiple image targets in an application, and I have a general script attached to each image target in the application.

In the script I have the following code:


var myTexture : Texture;
var showInstructions = true;
OnGUI()
{

  if(GUI.Button(Rect(0,0,1024,768), myTexture))
      showInstructions = false;

}

With the idea being that for each ImageTarget I can assign a Texture for a full screen GUI.Button splash screen. However, the way it works right now is that as soon as I load the application, my GUI.Button is already there.

Is there a better way to attempt what I'm doing, where the GUI.Button does not show up until the ImageTarget is locked on to?

So the result would be my AR elements loading, as well as a GUI.Button splash screen on top of it all.

Thoughts? Suggestions? :)

Thanks!

Re: Trigger onGUI when ImageTarget loads

November 4, 2011 - 5:10pm #2

What I do for this sort of thing is put my own code in the OnTrackingFound function in the TrackableEventHandler class. I hope that helps.

Log in or register to post comments