Saturday, 4 April 2015

Unity3D Tutorial Main Menu

Unity3D Tutorial Main Menu

Easter video series !

















THIS IS C# script: GOOD 4 2D GAMES AND 3D GAMES !
----------------------------------------­­­­­­­----------------------------------­-­-­-­-­-­-­------

DIRECT DOWNLOAD HERE




THIS IS BACKUP  IN TEXT FORM  TUTORIAL  DemoMainMenu

1. Create New C# and name it : DemoMainMenu


2. Copy & Past this text and save C# :
----------------------------------------­­­­­------------------------------------­-­-­-­-­-


using UnityEngine;
using System.Collections;

public class DemoMainMenu : MonoBehaviour {

private string[] tooltip;

// Use this for initialization
void Start () {
tooltip=new string[8];
//Buton 1 basic info text
tooltip[0]="Basic level ";

//Buton 2 basic info text
tooltip[1]="Level you die in you dream player ";

//Buton 3 basic info text
tooltip[2]="Level with multiple l";

//Buton 4 basic info text
tooltip[3]=" level with multiple  towers";

//Buton 5 basic info text
tooltip[4]="A mazing level";

//Buton 6 basic info text
tooltip[5]=" level  terrain Drag&Drop";

///Buton 7 basic info text
tooltip[6]="level with randomized  waves";

//Buton 8 basic info text
tooltip[7]=" level with ability system";
}

// Update is called once per frame
void Update () {

}

void OnGUI(){
//~

float startY=Screen.height/2-200;
float spaceY=45;

//Buton 1 basic name level1
GUIContent content=new GUIContent("Level 1", "1");
if(GUI.Button(new Rect(Screen.width/2-60, startY+=spaceY, 120, 35), content)){
Application.LoadLevel("level1");
}


//Buton 2 basic name level1
content=new GUIContent("Leve 2", "2");
if(GUI.Button(new Rect(Screen.width/2-60, startY+=spaceY, 120, 35), content)){
Application.LoadLevel("level2");
}


//Buton 3 basic name level1
content=new GUIContent("Leve 3", "3");
if(GUI.Button(new Rect(Screen.width/2-60, startY+=spaceY, 120, 30), content)){
Application.LoadLevel("put level 3 your level name here");
}
content=new GUIContent("Leve 4", "4");
if(GUI.Button(new Rect(Screen.width/2-60, startY+=spaceY, 120, 35), content)){
Application.LoadLevel("put level 4 your level name here");
}


//Buton 4 basic name level1
content=new GUIContent("Leve 5", "5");
if(GUI.Button(new Rect(Screen.width/2-60, startY+=spaceY, 120, 35), content)){
Application.LoadLevel("put level 5 your level name here");
}



//Buton 5 basic name level1
content=new GUIContent("Leve 6", "6");
if(GUI.Button(new Rect(Screen.width/2-60, startY+=spaceY, 120, 35), content)){
Application.LoadLevel("put level 6 your level name here");
}



//Buton 6 basic name level1
content=new GUIContent("Leve 7", "7");
if(GUI.Button(new Rect(Screen.width/2-60, startY+=spaceY, 120, 35), content)){
Application.LoadLevel("put level 7 your level name here");
}



//Buton 7 basic name level1
content=new GUIContent("Leve 8", "8");
if(GUI.Button(new Rect(Screen.width/2-60, startY+=spaceY, 120, 35), content)){
Application.LoadLevel("put level 8 your level name here");
}





if(GUI.tooltip!=""){
int ID=int.Parse(GUI.tooltip)-1;

GUIStyle style=new GUIStyle();
style.alignment=TextAnchor.UpperCenter;
style.fontStyle=FontStyle.Bold;
style.normal.textColor=Color.white;

GUI.Label(new Rect(0, Screen.height*0.75f+70, Screen.width, 200), tooltip[ID], style);
}
}
}







 ----------------------------------------­­­­­------------------------------------­-­-­-­-­-

0 comments:

Post a Comment