when I Start the game the my skin works.
skin is active and true prints a lot.
but when I change scenes and then come back to my Menu Scene
the skin is not active and it is printing false.
so my real question is why it is ever able to print false
since i am trying keep this skin applied the whole time.
void OnGUI (){
GUI.skin=darkness;
print(GUI.skin==darkness);
GUI.DrawTexture (new Rect (0,0,mainMenuTexture.width,mainMenuTexture.height), mainMenuTexture);
…
Perhaps you can share some info as to how you set your variable “darkness”? Is it set via the inspector, some other code elsewhere, other? Knowing how that variable is set/initialized will help us (hopefully) sort out why it might be null in later visits to the same scene/level.
Then I’m very puzzled as to why it wouldn’t be set properly when you return to that level a second time. In all your code is there anywhere else you set that variable via scripts? Perhaps you can post your project for us to peek at? (or send via PM?)
Sorry for not having something firm here but I’m at a loss to explain this behavior…
I am doing some rearranging of my scripts top make them make more readable for my project hopefully i will find the problem but if after this code clean up is done I am still having the error then I will post more.