``I have created many scenes. two scenes named “GameOver” and “ScreenSetting”. in these scenes i have made some texture with script. problem is that when i play this scene then it shows all the textures of scene but when i switch to other scene and come back to these two scene and play then no texture is displayed. whts the problem?
sample code is here `
function OnGUI() {
if(!soundTexture){
Debug.LogError("Assign a Sound Texture in the inspector.");
return;
}
GUI.DrawTexture(Rect((Screen.width*20)/100,(Screen.height*15)/100,(Screen.width*38)/100,(Screen.height*20)/100), soundTexture);
if(!vibrateTexture){
Debug.LogError("Assign a vibrate Texture in the inspector.");
return;
}
GUI.DrawTexture(Rect((Screen.width*21)/100,(Screen.height*43)/100,(Screen.width*38)/100,(Screen.height*20)/100), vibrateTexture);
if(!fastTexture){
Debug.LogError("Assign a fast Texture in the inspector.");
return;
}
GUI.DrawTexture(Rect((Screen.width*20)/100,(Screen.height*70)/100,(Screen.width*38)/100,(Screen.height*20)/100), fastTexture);
if (GUI.Button(Rect((Screen.width*5)/100,(Screen.height*80)/100,(Screen.width*20)/100,(Screen.height*20)/100),back,testStyle)){
Application.LoadLevel("StartScene");
Handheld.Vibrate();
}
}
`
these are the texture which i have defined in setting Scene, when I assign all the texture and play first time then it shows all the texture but when i switch to other scene and come back to setting scene then no texture appears when i play