In QuickLook you donāt get these kind of lifecycle events unfortunately - you only get what Appleās preliminary behaviours provide, which weāre matching and extending in our Everywhere Actions
May I ask what your goal is?
Sure.
The component Web XR Image Tracking has a list of Tracked Images , each of these has a Image and a Object which will be activate when the image is detected.
I want to log or store the Image path when that image is detected. Thats the first goal.
by user 632418299711324161
My first test was using what you said me about the onEnable and onDisable
`onEnable(): void {
(this.imageTracking.trackedImages).forEach((_img)=>{
console.log(_img);
if(_img.object!.asset === this.gameObject){
console.log("Detect the object");
console.log("Image :", _img.image);
console.log("Object :", _img.object!.asset);
for (let i = 0; i < this._modelRenderer.sharedMaterials.length; i++) {
this._modelRenderer.sharedMaterials[i]["color"].setRGB(Math.random(), Math.random(), Math.random());
}
}
})
}`
by user 632418299711324161
Thats just a test which changes the color of the model when is reconized.
by user 632418299711324161
In iOS AR / QuickLook you donāt get any storage or script execution, itās really a pretty limited sandbox (limited by Apple). Itās āmodel display and simple behaviours like click-to-animateā
Typically youād have people configure something while still in the browser (e.g. in a product configurator, choose a specific product and settings) and then they enter AR to view it.
Configurability in AR can make sense but often complicates things for users
This page contains a number of samples for how far you can drive interactivity on QuickLook: Augmented Reality Showcase
Okey, really, thank you : )
And in the case using Web XR ?
by user 632418299711324161
Unlimited Power!
When youāre in WebXR youāre still on the same page, not in a sandbox, so can be fully programmed
One question,
If I check the Image Does Not Move, Are the onEnable/onDisable callbacks still called each time the object is detected?
by user 632418299711324161
Yes they are. They are called whenever an object becomes active