Hi im new to unity (and programming!). i got a anoying problem and i would really need some help.
When i first start the menu scene, everything works properly, then i go to another scene and work there, when i go back to start the first scene(menu) the gui button are invicible. This i know because i can still press it because i remember where it were
Those are the scripts
script 1, used for the menu buttons:
using UnityEngine;
using System.Collections;
public class Start : MonoBehaviour {
bool showBox = false;
// Use this for initialization
void Start1 () {
}
// Update is called once per frame
void Update () {
}
void OnGUI(){
if (GUI.Button (new Rect (Screen.width / 2 - 50, Screen.height / 2 - 200, 200, 75), "<size=40>Start</size>")) {
showBox = true;
}
if (showBox) {
GUI.Box (new Rect (0, 0, 100, 25), "Loading...");
Application.LoadLevel ("något");
}
}
}
script 2, used for background image:
using UnityEngine;
using System.Collections;
public class BackgroundMeny : MonoBehaviour {
public Texture2D BackgroundMenu;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
void OnGUI()
{
GUI.DrawTexture(new Rect(0, 0, Screen.width , Screen.height ), BackgroundMenu, ScaleMode.StretchToFill, true, 10.0F);
}
}
so currently i have to make a new button script everytime for my menu to work. is this a bug or what? All help would be appreciated