- Home /
Question by
COLLAnitySV · Oct 27, 2011 at 03:21 PM ·
3ditweensettingsmain menu
3D Main Menu Problem
Hey, everybody i've got a problem about the 3D Main Menu from burgzerg arcade this is the script
var menuItems:Menutem[];
var menuItemz:Menutemz[];
var currentMenuItemz:int = 0;
var beep : AudioClip;
var beepExit : AudioClip;
var beepChoose : AudioClip;
var camera1 : Camera;
var camera2 : Camera;
var currentMenuItem:int = 0;
var textD3:TextMesh;
var keyDelay:float = 0.25;
function Start(){
Screen.showCursor = false;
Menu();
}
function Menu()
{
settingsCript = GetComponent(SettingsManager);
menuItems[currentMenuItem].OnSelected(true);
var lastMenuItem:int = currentMenuItem;
while(true)
{
if(Input.GetAxisRaw("Vertical") > 0.9)
{
lastMenuItem = currentMenuItem;
currentMenuItem--;
audio.PlayOneShot(beepChoose);
if(currentMenuItem < 0) currentMenuItem = 0;
if(lastMenuItem != currentMenuItem)
{
menuItems[lastMenuItem].OnSelected(false);
menuItems[currentMenuItem].OnSelected(true);
}
yield new WaitForSeconds(keyDelay);
}
else if(Input.GetAxisRaw("Vertical") < -0.9)
{
lastMenuItem = currentMenuItem;
currentMenuItem++;
audio.PlayOneShot(beepChoose);
if(currentMenuItem >= menuItems.length) currentMenuItem = menuItems.length - 1;
if(lastMenuItem != currentMenuItem)
{
menuItems[lastMenuItem].OnSelected(false);
menuItems[currentMenuItem].OnSelected(true);
}
yield new WaitForSeconds(keyDelay);
}
yield;
if(Input.GetButtonDown("Jump"))
{
if(currentMenuItem == 0)
{
audio.PlayOneShot (beep);
yield new WaitForSeconds(1.0);
LevelLoadFade.FadeAndLoadLevel("tessst", Color.white, 0.5);
AudioListener.volume = 0.3;
}
if(currentMenuItem == 1)
{
camera1.enabled = false;
camera2.enabled = true;
SettingsArea();
}
if(currentMenuItem == 2)
{
audio.PlayOneShot (beepExit);
yield new WaitForSeconds(0.8);
Application.Quit();
}
}
}
}
function SettingsArea (){
menuItemz[currentMenuItemz].OnSelected(true);
var lastMenuItem:int = currentMenuItemz;
while(true)
{
if(Input.GetAxisRaw("Vertical") > 0.9)
{
lastMenuItem = currentMenuItemz;
currentMenuItemz--;
audio.PlayOneShot(beepChoose);
if(currentMenuItemz < 0) currentMenuItemz = 0;
if(lastMenuItem != currentMenuItemz)
{
menuItemz[lastMenuItem].OnSelected(false);
menuItemz[currentMenuItemz].OnSelected(true);
}
yield new WaitForSeconds(keyDelay);
}
else if(Input.GetAxisRaw("Vertical") < -0.9)
{
lastMenuItem = currentMenuItemz;
currentMenuItemz++;
audio.PlayOneShot(beepChoose);
if(currentMenuItemz >= menuItemz.length) currentMenuItemz = menuItemz.length - 1;
if(lastMenuItem != currentMenuItemz)
{
menuItemz[lastMenuItem].OnSelected(false);
menuItemz[currentMenuItemz].OnSelected(true);
}
yield new WaitForSeconds(keyDelay);
}
yield;
if(Input.GetButtonDown("Jump"))
{
if(currentMenuItemz == 0)
{
audio.PlayOneShot (beep);
}
if(currentMenuItemz == 1)
{
ShowDevice();
}
if(currentMenuItemz == 2)
{
}
if(currentMenuItemz == 3)
{
camera1.enabled = true;
camera2.enabled = false;
}
}
}
}
function ShowDevice() {
textD3.text = ("System Info"+"\n"+"\n"+"Unity player version : "+Application.unityVersion+
"\n"+"Operating System :"+SystemInfo.operatingSystem+"\n "+
"Processor :" + SystemInfo.processorType+"\n"+
"Graphic Card:"+SystemInfo.graphicsDeviceName+"\n"+
"Shader Model:"+SystemInfo.graphicsShaderLevel );
}
@script RequireComponent (AudioSource)
Sorry it's 189 lines :) My Problem on this script is
On Main Menu, i've pressed Settings, the Main Menu Function did not turn off itself (I mean the main menu function still working, here's for the video http://youtu.be/2MqQOhmns-Y)
how to make when you press the game settings button it appear a game settings, if you press the systems button the game settings will be disapear and appear the systems option
I really need to fix this script. please anyone please help me...
Thank You very Much for the reply and read... :D
Comment