I just want to do a fade to white between a menu button click and the level load.
So I’m using a flat 2x2px white texture as a prefab and resizing it using a script on instantiation.
I can get the white fade to render in front of statically placed objects (by playing with Z transform values), but my menu buttons are still showing over the fade.
Any way to get the white fade in to also cover the scripted menu buttons? Hope my explanation is clear.
Cheers.
You could hide the buttons.
– biohazard2uThe question is about OnGUI code, not game objects. It also wouldn't look good if you just turned the buttons off before fading to white.
– Eric5h5Any OnGui code has to go in a GameObject... If you don’t want to turn them off, you can modify their alpha. Perhaps adding a Guistyle and changing the alpha value on normal/hover... :)
– biohazard2uOr just use DrawTexture, as I mentioned in my answer. Also you can just use GUI.color to change alpha, you don't need to add styles or anything.
– Eric5h5Thanks, I'll try putting it in OnGUI and see how that goes.
– TomMakesGames