Jingwei
Jingwei

Reputation: 755

iOS Native Project Integrates Vuforia Unity Project

I have two projects. One is native iOS app (UIKIT) and the other is AR Vuforia project which was made by Unity3D.

I can export AR project into XCODE project, but I am wondering how to link them together.

For example, I have a button on native iOS app. I want to trigger AR project when button is pressed and it can go back to native iOS app as well.

Upvotes: 2

Views: 1674

Answers (1)

Jingwei
Jingwei

Reputation: 755

I finally worked it out by myself. Unity project must be rootviewcontroller, but you could add a separate navigation controller on the top of unity. You could add native code into AppController.m

Communication between native and unity is quiet simple.

Call

UnitySendMessage (gameObj, methodName, msg);

to send message to unity method

Use

extern "C"

to receive call back from unity.

I can provide some sample code if someone needs it.

Upvotes: 4

Related Questions