GUI is not function correctly when using 'Application.LoadLevel' in C#.

Hi… friends I am working on a Tic Tac Toe project since 2-3 days… all is running fine.I have also made a Main Menu for it so that, when user clicks on the New game button it changes the scene to the main game of Tic Tac Toe. But the GUI buttons in the main game i.e. the boxes in which the user has to put those Xs and Os are not displaying in the proper manner. I have used ‘Application.LoadLevel’ in C# to make this all happen. However those GUIs buttons display all correctly when I open my main game scene rather than switching it from the main menu. Please answer if you know the solution of this situation.

I have made this is my coding---->>>>>

void OnGUI(){

if(GUI.button(new Rect(0,0,300,300)))
Application.LoadLevel("MainMenu");

}

whats wrong in this???

What should I do to display those GUI buttons in the correct manner???

How you explained what you wanted is very confusing but this is what I understood from what you wanted:

If you want a button that starts the level, you have to capitalize the B is in Button so it’s GUI.Button and you need to put a text after your dimensions. Here’s an example:

using UnityEngine;
using System.Collections;

public class LoadLevel : MonoBehaviour {

	// Use this for initialization
	void OnGUI(){
		
		if(GUI.Button(new Rect(0,0,300,300), "Start")){
			Application.LoadLevel("MainMenu");
		}
		
	}
} 

Hopefully that helps you get started. Also I don’t usually code in C# but this should work.