This GUI bug I've been wrestling with lately was a bug for the history books. It didn't reproduce on my dev system - it *did* reproduce on my laptop, but out of nowhere that's when my laptop stopped being able to run Unity properly. I started seeing this...and it would crash when I tried to open MonoDevelop. Exciting. So a lot of building on one dev system and sending it over to the other, when my local network would let me, with its Windows groups bullshit. (Running it back and forth with a USB the rest of the time.)
Happily, shout out to Imron Alston who figured out how to repro it on a Mac, improving my iteration time greatly, and shout out to Tasharen / NGUI who had awesome support on their forums. But even when Tasharen told me how to fix the bug it still didn't get fixed. Why? Because of this block of code:
if( AddedQualitySettings.oculus )
{
// ...
}
else
{
Debug.Log("Oculus camera disabled.");
// here's the offending line:
GetComponentInChildren<Camera>().clearFlags = CameraClearFlags.Nothing;GetComponentInChildren<Camera>().targetTexture = null;
}
It was supposed to be CameraClearFlags.Depth, and when Tasharen told me that I went and changed it. IN THE INSPECTOR. Not in this code I'd written that overrides the inspector which I forgot about it. So I kept complaining to them, "That didn't fix it! It still doesn't work!"
Until I got lucky and finally noticed that my script was changing it back.
SO. Going forward: let Unity be Unity. Avoid having script override stuff when I can. In cases like this, pick one thing to be the default, and that's what's in the inspector, and let the code override the other one.
And I'll have an update out with the new prettier UI working in both regular and Oculus mode plus y-axis flipping soon.
Comments