Finally decided!
In the treasurehunt example, you can find a method isLookingAtObject()that determines where the user is looking for ...
And another method called onNewFramethat performs some action in each frame ...
My solution for our problem:
in onNewFrame method :
if (isLookingAtObject()) {
selecting++;
} else {
selecting = 0;
}
if (selecting == 100) {
startYourFunction();
selecting = 0;
}
}
, 100 , , , 100, reset .
, .