GameOverScreen.OnGUI C# (CSharp) Method

OnGUI() public method

public OnGUI ( ) : void
return void
    public void OnGUI()
    {
        GUI.skin = skin;
        Color baseline = GUI.color,
          contentBaseline = GUI.contentColor;
        GUI.contentColor = Color.red * 0.75f;
        GUI.color = Color.red * 2.0f;

        GUILayout.BeginArea(new Rect((Screen.width - 150) / 2, (Screen.height - 100) / 2, 150, 100), "GAME OVER!", "window");
          GUILayout.Label("LOSER!", "CenteredLabel");
          GUI.contentColor = Color.green * 0.75f;
          GUI.color = Color.green * 2.0f;
          if(GUILayout.Button("Play again?")) {
        Application.LoadLevel(Application.loadedLevel);
          }
        GUILayout.EndArea();

        GUI.color = baseline;
        GUI.contentColor = contentBaseline;
    }