Can I save image from www and put it in Resources folder and select target from here?

0 votes
asked Jul 31, 2018 by kjurek (140 points)
How can I use StorageType.json?
How can I use StorageType.App?

1 Answer

+1 vote
answered Jul 31, 2018 by tagchennai (620 points)
I believe that you are using Unity3D for development, sadly, Resources cannot be used at runtime, as it is built into the app before runtime itself, in other words, your application does not really have the Resources folder anymore, you would have to save the image to a path after converting it to a texture, you would have to use persistent datapath to save it as .jpg, havent tried it before, but should work. So, you can use images in the Resources folder that were built into the app, but cant add new stuff into Resources at Runtime sadly.
commented Jul 31, 2018 by kjurek (140 points)
Thank you for your answer. So, when I use StorageType, I must use StorageType.App, or StorageType.Absolute? I know hot to save texture to Application.PersistenPath, but how to call it ?

targetBehaviour.SetupWithImage("test/test.png", StorageType.Assets, "test", new Vector2());

thank you.
commented Jul 31, 2018 by tagchennai (620 points)
edited Jul 31, 2018 by tagchennai
Then you would already have the path to the image(Ex :test/test.png), then, you would have to add the texture to a plane or a quad which is set inactive and add imagetargetbasebehaviour to it, and then bind it to the tracker, this way, you might be able to add images to the tracker at runtime, this is just my hypothesis, havent really tried it yet.

https://www.easyar.com/doc/EasyAR%20SDK/Unity%20Plugin%20Reference/2.0/ImageTargetBaseBehaviour.html

This should help you set target with tracker, i guess.
I think StorageType.Absolute should be used, for reasons, i am not too sure, it just feels right......, cuz persistent path is an absolute type imo, hope this helps
Welcome to EasyAR SDK Q&A, where you can ask questions and receive answers from other members of the community.
...