How to properly integrate Unity + Vuforia into an existing native iOS Project?
Asked Answered
B

2

0

We have created a project with Unity 2017.3 and Vuforia 6.0.114 and need to integrate it into a native iOS App with already existing AppDelegate and existing ViewContollers. We still want to launch our own AppDelegate and starting ViewController but on some point later the Unity+Vuforia-Controller shall be entered.

We are familiar with the process of integrating a Unity App into a native iOS App itself and we made everything work fine as long as there is no Vuforia involved.

The problem is that Vuforia itself subclasses Unity's Controller (in VuforiaNativeRendererController.mm) by using the IMPL_APP_CONTROLLER_SUBCLASS(VuforiaNativeRendererController) mechanism.

This is actually the same way we subclass our own iOS native App, thus we have a conflict. We can either start our part and take control of Unity or let Vuforia do it.

The question now is: Is it possible to somehow further subclass Vuforia or something similar? And if so, how could this be achieved?

Blaspheme answered 25/1, 2018 at 15:39 Comment(0)
R
0

We recently hit that exact same road bump. Using this method to integrate the Unity app into our existing native iOS project, we managed to bypass the renderer issue. Just make sure you turn off Auto Graphics API in Unity's player settings and use OpenGLES2 instead of Metal

Unity player settings

Ripleigh answered 25/1, 2018 at 17:51 Comment(3)
While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - From ReviewSteamroller
Agreed! However, the essential parts of the link's content comprise of several files on the repo, which I can't really copy/paraphrase on here. Besides, the OP wrote they're well past the integration part, so the link isn't the answer here (I was just making sure we're on the same page), the rendering settings part is.Ripleigh
We used the same method from swift-unity-repository as you have mentioned in your answer. However, our issue is another one. It is that the described and official way how to use an own ViewController instead of the Unity-Controller is the same that Vuforia is using. This means that we would override the Vuforia-Approach what causes other issuesBlaspheme
B
0

I know this question is old, but pops-up in search and there is a solution.

Here's guide on Using Vuforia Engine with Unity as a Library (UaaL)

Belated answered 28/3, 2020 at 20:42 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.