- Home /
Question by
benjimazza · Apr 08, 2012 at 05:48 PM ·
graphicsoptions
activate menu using the letter 'A'
okay basically i want to activate the graphics option using the button 'A' here is the code:
var BackBoxY : float = 250;
var BackBoxZ : float = 100;
var menu : boolean = false;
function Start()
{
menu = false;
}
function Update()
{
if(Input.GetKey(KeyCode.A))
menu = true;
}
function OnGUI () {
// Make a background box
GUI.Box (Rect (10,10,BackBoxZ,BackBoxY), "Graphics Resolution");
// Make the first button. If it is pressed, Application.Loadlevel (1) will be executed
if (GUI.Button (Rect (20,40,80,20), "Fastest")) {
QualitySettings.currentLevel = QualityLevel.Fastest;
}
// Make the second button.
if (GUI.Button (Rect (20,70,80,20), "Fast")) {
QualitySettings.currentLevel = QualityLevel.Fast;
}
// Make the second button.
if (GUI.Button (Rect (20,100,80,20), "Simple")) {
QualitySettings.currentLevel = QualityLevel.Simple;
}
// Make the second button.
if (GUI.Button (Rect (20,130,80,20), "Good")) {
QualitySettings.currentLevel = QualityLevel.Good;
}
// Make the second button.
if (GUI.Button (Rect (20,160,80,20), "Beautiful")) {
QualitySettings.currentLevel = QualityLevel.Beautiful;
}
// Make the second button.
if (GUI.Button (Rect (20,190,80,20), "Fantastic")) {
QualitySettings.currentLevel = QualityLevel.Fantastic;
}
}
Comment
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Help with Array script 1 Answer
Unity Networking, connecting to sever problems :( 1 Answer
Need code help from smart people 1 Answer
Quick Custom Inspector Question 1 Answer