In our browser game we have the main page which contains a fixed-size iFrame. This iFrame holds our Unity object which has the same dimensions as the frame. So, to the user it looks like there is “only” the Unity object and no iFrame.
At times we want to hide Unity to display other information. To do that take a previously hidden object that also “sits” in the iFrame and make it visisble. This moves Unity “down”, and as the iFrame is fixed size, Unity get’s hidden. Imagine it like this (pseudo-code)…
We make ‘popupmessage’ visible, which causes Unity to be hidden (because it moves downwards “out of the frame”).
However, since updating to 2.5.1, this behavior does not work anymore. It seems not possible to hide Unity via “regular” JS/CSS code. Unity still renders even if it should be hidden, but interestingly it doesn’t scroll with the page anymore (it seems to “think” it is hidden, but actually it is not). Same applies if you set the height or width of the Unity object to “0px”.
What is possible is that you do something like GetUnity().style.display = “none”, which will in fact hide Unity. However, making it visible again using “block” will cause Unity to completely reload. Unfortuantely this is not what we intend.
First off, if you have an example of this issue in action and it’s truly new to 2.5.1 then please submit that as a bug right away so we can look into that. I’m a bit stumped as to a workaround/solution as my mind immediately ran to “set the display to none!” (fail), and “set the width/height to zero pixels!” (fail again).
So get a bug logged, I’ll noodle on this and maybe others can chime in?
I’ve been meaning to poke at how the Unity web player content can be manipulated (in order to accommodate Facebook Connect popups and other things). I’ll report back soon!
Anyone using the Aquiris U3dObject that can comment on how it hides/reveals content and whether it’s having issues with 2.5.1? Of course I’ll go test the Aquiris content that uses it myself, I’m just askin’ in case folks here have comments already.
Below the Unity window, the game must show “Version A” (this is what this post refers to)
In Unity, click the yellow “Invite friends” button (not the one on the top right!)
Result: Notice that after click, the Unity window remains visible but doesn’t scroll anymore. In the background you see the “new” content. Normally, Unity should have been hidden (it used to work before I upgraded my webplayer).
Just when trying that out I noticed that Unity does indeed disappear when you change browser tabs and then go back.
If you think this is indeed a bug I will go post it.
Interesting to hear about your findings! It’s a bit annoying for the user and the overall experience when you have to hide Unity just to show a Facebook story feed etc…
Impossible to say. All bugs go to our dev/qa team and they have to prioritize all work, some bugs get fixed quickly others take more time. There’s no real way for me to offer a useful estimate.