Ok, i figured it out. Problem was the way blursts “tutorial” sets up the views. For those of you interested:
Blursts description first doesn´t use the unity startupway, instead they change it to their own, loading UIViews
After they do that the basic siblings look like this:
This Structur already leads to problems with autorotation. Turned out that only the first added UIView will rotate as expected. All the other ones not.
So i changed this to
Now rotation of all Views is ok, even if you add them at a later time.
When they call their launchUnity method, it will start Unity (and i guess change the topmost UIWindow, but am not sure). Anyways, the structur looks like this:
The Eventsystem on the iphone works like this:
The visible topmost UIView or other Class will recieve the touch Events. If it doesn´t handle the Event, the Event gets automatically passed to its superView until it gets somewhere handled or reaches the top of the responder chain.
With the currentsetup, imagine SceneTitle is visually on the top and a touch occurs and that touch is not handled by something inside this UIView, then the event bubbles up:
- UIWindow (> as nextResponder recieves unhandled Event ContainerView)
-
-
ContainerView (UIView) (> as nextResponder recieves unhandled Event from SceneTitle)
-
-
-
-
SceneTitle (UIView) (> gets TouchEvent)
-
-
-
-
As you can see, the Event cannot reach unitys view, as it is not inside the responderchain. Luckily it turns out, that you can actually add subViews to the EAGLView. Thats solves the Problem:
- UIWindow
→ ContainerView (UIView)
-
-
-
-
-
-
-
SceneAndSoOn (UIView)
→ unityView (EAGLView)
-
This structur is fine. SceneGui is now a “layer” on top of unity, can handle events or pass them to unity.
The other scenes are still outside. Imagine you have scenes like intro, outro, help and so on, they don´t need to be inside the responder chain.
So far i tested this in a supersimple testProject, will now try to change the real one accordingly.
Don´t know if this has some evel sideeffect so far