By youmix90
on Sun, 10/16/2016 - 21:04
Hello,
I'm newbie in Vumark. I want to make a simple app that get the ID of a trackable Vumark and depending on the ID, It swap the 3D model.
For example :
public VumarkTarget vumark;
public Gameobject teapot;
public Gameobject tower;
if (vumark.ID = 1)
{ teapot.setactive(true);
tower.setactive(false);}
else {
teapot.setactive(false);
tower.setactive(true);
}
I wonder how can I instantiate my vumark via editor or via script like I can do to Gameobject (teapot and tower) ? I read the vumark sample and the imagetarget sample but I couldn't understand how I instantiate my vumarktarget to get its ID.
Thanks for helping
After a deep observation of
After a deep observation of the Vumark Sample app, I come up with this script which works perfectly. Tower and Teapot are two 3D models that I have assigned them in the editor inspector :
[quote]
To answer your question
To answer your question directly:
1 - Update() is a continuous loop that runs over and over as long as your application is running.
2 - foreach is another form of loop but these are specific and need direction like "loop through each vumark".