Change ImageTarget during runtime

0 votes
asked Apr 11, 2021 by guilhermeflex (610 points)
Hello! I want to download a few images from my asset bundle and use them as target for Image Track.

Can I download the imagem directly into StreamingAssets and change the image tracking reference during runtime?

Thank you!

2 Answers

0 votes
answered Apr 12, 2021 by kenn (18,790 points)
Of course. Try the sample.
commented Apr 13, 2021 by guilhermeflex (610 points)
Which sample? I couldn't find a sample specific for this feature.
commented Apr 13, 2021 by kenn (18,790 points)
The samples load images from streaming assets, aren't they what you looking for?
commented Apr 14, 2021 by guilhermeflex (610 points)
Noup. I want to make a project with one target and build for Android/iOS. AFTER I built, I want to use Unity's asset bundle to add more targets, with user downloading images from their phone and setting these new images as targets.

Not in Unity scene, doing that in the live app downloaded from the store
commented Apr 14, 2021 by kenn (18,790 points)
Not sure about what you are trying to do. But let me explain in another way.
The samples show how to create a target from memory buffer or image file. If you can find a way to create an image file (jpg or png) or get image byte array (byte []), then you can do it.
I believe getting image file or byte array will not be a blocking issue, at least they are not something AR related.
commented Apr 15, 2021 by guilhermeflex (610 points)
Thanks!
That's sort of what I wanted!
So, EasyAR documentation doesn't have a tutorial on how to achive what you explained, right?

At least I couldn't find.

The idea is to create new targets during runtime by downloading images on my smartphone.
commented Apr 15, 2021 by kenn (18,790 points)
0 votes
answered Apr 19, 2021 by creartivity (210 points)
Hello!

Let me know if you got it working! I'm doing the same thing, loading targets from a downloaded image, i got it working in unity editor, but i had no luck with it on android build, also adding file:// at the beginning of the loading path of the imagetarget.
Welcome to EasyAR SDK Q&A, where you can ask questions and receive answers from other members of the community.
...