TabBar Controller

Hi,

it it possible to assign the UnityGLViewController singleton as a TabBarController child controller? It’s not yet working so I’m wondering if it is possible at all…

what I’m doing so far is:

First off all: I didn’t modify any code created by Unity (3.5.6f4) except for my own main.mm. In this file I instantiate my own AppController class which is subclassed from the original AppController. In the overloaded method didFinishLaunchingWithOptions I call initially the super class method which does all the regular Unity init stuff. Then I store the application window’s root controller, which is the Unity GL View Controller singleton, into a property and assign my own root controller. Everything works fine so far.

My own root controller is a navigation controller that finally calls a TabBarController to which the original Unity controller is assigned as one of it’s child controllers. Unfortunately this tab remains black. The whole App is running properly. So I guess Unity is invisible somewhere in the background…

(1) Is the approach described above in general okay?
(2) Do you have any hints what could be wrong and cause the black screen?

Thx a lot in advance…

Ekki

Issue solved. Works as expected now.

Hi Ekki,

I’m encountering the same problem and I wonder what you did to get Unity in the tab bar controller to work?

Thanks!

I do grab the application window’s rootController, store it in a property, assign my own rootController, and assign the stored rootController to the TabBar later on.

Thanks!

I managed to do that successfully. However, I seem to have a rotation issue where my unityview will get stretched to fit.

If I’m on the Unity tab and I rotate, everything rotates properly. But if I go to another tab, rotate my device, and then go back to the unity view, the unity view will be stretched to fit.

Did you encounter a similar issue?

I had a rotation issue which I solved with assigning an ‘empty’ matrix to the Unity view:

*.view.transform = CGAffineTransformMakeScale(1.0, 1.0);

Ekki