How to migrate a Unity app from 2.3 to 3.0?

+3 votes
asked Jul 16, 2019 by dg3europe (210 points)
Do I simply just import the 3.0 unitypackage into my 2.3 project and let it overwrite files? Thanks.

3 Answers

+1 vote
answered Jul 16, 2019 by adenio (1,250 points)
Do not do it! If you do this, you will lose your project. The plugin was rewritten and the structure changed. Some scripts have been deleted and there are many new ones ... I have the same problem here. I think we'll have to redo our projects, or wait for an API documentation. Surprisingly, the developers of this amazing plugin are ignoring the community's appeals. Waiting for a solution ...
commented Jul 16, 2019 by dg3europe (210 points)
I made a copy of the project and tested. It didn't work. Then I checked out their ImageTarget sample and see they've changed the structure. I notice however, this time they didn't include any prefabs for the EasyAR_Setup nor ImageTarget. So I will make prefabs myself from their sample.

The only thing I need to find out next is where the license key goes! I couldn't see any obvious place from within the sample. Do you know?
commented Jul 16, 2019 by wjrivera (800 points)
commented Jul 16, 2019 by ngc6543 (1,670 points)
At least they now give you the source code for C# side now... You can tweak the code to suit your need.
commented Jul 17, 2019 by adenio (1,250 points)
Yes! That's really good. A positive point for developers.
+1 vote
answered Jul 17, 2019 by adenio (1,250 points)
Hi. I did this:

Initially, I completely deleted EasyAR 2 with the associated plugins from my project to avoid conflicts and imported the new EasyAr 3.0 with just one sample - HelloAR_ImageTarget.

1- I copied the camera, the EasyAR_Setup and the ImageTarget, from the HelloAR_ImageTarget scene and pasted it into my scene.
2 - So I removed the objects inside the new ImageTarget and replaced them with mine - Then I deletes the old ImageTarget from EasyAR 2.3.
3- Then I also changed the image in the ImageTarget / Target Name field and ImageTarget / Target Path by mine in the StreamingAssets.
4- I reconnected the EasyAR_Setup / ARSession / Img Tracker and EasyAR_Setup / ARSession / Camera Background Renderer fields as well as EasyAR_Setup / ImageTracker / Target Camera.

It worked but I still need to adjust the camera because it is showing the 3D object aside ... I will make the final adjustments soon ... I hope this procedure helps you to have a direction to follow.
commented Jul 17, 2019 by adenio (1,250 points)
reshown Jul 17, 2019 by adenio
Solved the "3D object aside" (Mentioned above):
In ImageTracker I changed the CenterTarget parameter from Camera to First Target. (I have four ImageTracker in this scene)
commented Jul 17, 2019 by dg3europe (210 points)
Hi and thanks for your updates. Yes, I was able to successfully migrate to 3.0 thru the method I was planning (deleting 2.3 plugin, importing 3.0 plugin and importing prefabs exported from sample). I just had some issues with my scripts which were interfacing with ImageTargetBaseBehaviour for capturing onTrackingFound/Lost. So I had to rewrite some code.

My project also has canvases at 'World Space' render mode which I couldn't interact with (buttons, videos, etc). Attaching the Camera to the canvas' Event Camera resolved this.

I notice tracking in 3.0 seems more robust. I dropped the 'extended tracking' script now. So good on the team for improving on that.
commented Jul 18, 2019 by adenio (1,250 points)
Finally works! But one more thing ... why... WHY, the developers changed the camera position to the FRONT and not to ABOVE (like in 2.3) of the target ??? (What's the logic for that? Targets will usually be on a horizontal surface, like a table or on the floor!) I had to turn all my targets at 90 degrees ... But, it works. Finally!
+1 vote
answered Jul 18, 2019 by tcmxx2 (340 points)
You will have to read the source codes of sdk3.0 and modify it....and change your own codes because the API was changed. There are also some discrepancies with transforms/matrix. EasyAR's backend algorithms are using right-hand convention while Unity uses left-hand...
commented Jul 19, 2019 by adenio (1,250 points)
Yes, this same problem occurred with version 1 (if I remember correctly) of this plugin. They are repeating the error. Why create a Unity plug-in that uses a different coordinate system (conventions) than Unity uses? It makes no sense! I hope this is adjusted ... I really ask you, developers, to do this please !!!
Welcome to EasyAR SDK Q&A, where you can ask questions and receive answers from other members of the community.