Hi guys, sorry to bother, I wrote some code and I wonder why its not displaying the code on 2D because it worked before for me on a 3D environment, please any advice and help would be greatly appreciated.
using UnityEngine;
using System.Collections;
public class Menu : MonoBehaviour
{
public GUISkin skin = null;
public float widthPercent = 0.3f;
public float heightPercent = 0.3f;
public Texture2D logo = null;
void onGUI()
{
GUI.skin = skin;
// Calculate the menu rect
Rect r = new Rect(Screen.width * (1 - widthPercent) / 2, Screen.height * (1 - heightPercent) / 2, Screen.width * widthPercent, Screen.height * heightPercent);
// Draw logo, centered at the top right of the of the menu
if (logo != null)
{
Rect l = new Rect(r.x + r.width - logo.width / 2, r.y - logo.height / 2, logo.width, logo.height);
GUI.DrawTexture(l, logo);
}
// Draw the menu
GUILayout.BeginArea(r);
GUILayout.BeginVertical("box");
if (GUILayout.Button("Play"))
Application.LoadLevel("Level 1");
if (GUILayout.Button("Quit"))
Application.Quit();
GUILayout.EndVertical();
GUILayout.EndArea();
}
}