Advertisement
SofianeLasri

Menu 2.js

Oct 11th, 2015
342
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.93 KB | None | 0 0
  1. var mainMenuSceneName : String;
  2. var pauseMenuFont : Font;
  3. private var pauseEnabled = false;
  4.  
  5. function Start(){
  6. pauseEnabled = false;
  7. Time.timeScale = 1;
  8. AudioListener.volume = 1;
  9. Screen.showCursor = false;
  10. }
  11.  
  12. function Update(){
  13.  
  14. pauseEnabled = true;
  15. AudioListener.volume = 1;
  16. Time.timeScale = 1;
  17. Screen.showCursor = true;
  18.  
  19. }
  20. private var showGraphicsDropDown = false;
  21.  
  22. function OnGUI(){
  23.  
  24. GUI.skin.box.font = pauseMenuFont;
  25. GUI.skin.button.font = pauseMenuFont;
  26.  
  27. if(pauseEnabled == true){
  28.  
  29. //Make a background box
  30. GUI.Box(Rect(Screen.width /2 - 600,Screen.height /2 - 270,250,250), "Quoi de neuf?");
  31. GUI.TextArea(Rect(Screen.width /2 - 600,Screen.height /2 - 250,250,250), "- Ajout de la map WTF?! - Ajout de la musique d'ambiance sur la map WTF?! -Viens suivre le dรฉveloppement du jeu sur Actu-Gamework! http://forum.actu-gamework.com :) ");
  32.  
  33. //Make Main Menu button
  34. {if(GUI.Button(Rect(Screen.width / 2 - 600, Screen.height / 2 - -250, 200, 50), "Jouer"));
  35. Application.LoadLevel("CompleteScene");}
  36. {if(GUI.Button(Rect(Screen.width / 2 - 600, Screen.height / 2 - -200, 200, 50), "Jouer sur la map WTF?!"));
  37. Application.LoadLevel("map 2");}
  38.  
  39.  
  40. //Make Change Graphics Quality button
  41. if(GUI.Button(Rect(Screen.width / 2 - 350, Screen.height / 2 - -250, 200, 50), "Options")){
  42.  
  43. if(showGraphicsDropDown == false){
  44. showGraphicsDropDown = true;
  45. }
  46. else{
  47. showGraphicsDropDown = false;
  48. }
  49. }
  50.  
  51. //Create the Graphics settings buttons, these won't show automatically, they will be called when
  52. //the user clicks on the "Change Graphics Quality" Button, and then dissapear when they click
  53. //on it again....
  54. if(showGraphicsDropDown == true){
  55. if(GUI.Button(Rect(Screen.width /2 - 350,Screen.height /2 - 50,250,50), "Tres bas")){
  56. QualitySettings.currentLevel = QualityLevel.Fastest;
  57. }
  58. if(GUI.Button(Rect(Screen.width /2 - 350,Screen.height /2 + 0,250,50), "Bas")){
  59. QualitySettings.currentLevel = QualityLevel.Fast;
  60. }
  61. if(GUI.Button(Rect(Screen.width /2 - 350,Screen.height /2 + 50,250,50), "Normale")){
  62. QualitySettings.currentLevel = QualityLevel.Simple;
  63. }
  64. if(GUI.Button(Rect(Screen.width /2 - 350,Screen.height /2 + 100,250,50), "Bien")){
  65. QualitySettings.currentLevel = QualityLevel.Good;
  66. }
  67. if(GUI.Button(Rect(Screen.width /2 - 350,Screen.height /2 + 150,250,50), "Elever")){
  68. QualitySettings.currentLevel = QualityLevel.Beautiful;
  69. }
  70. if(GUI.Button(Rect(Screen.width /2 - 350,Screen.height /2 + 200,250,50), "Ultra")){
  71. QualitySettings.currentLevel = QualityLevel.Fantastic;
  72. }
  73.  
  74. if(Input.GetKeyDown("escape")){
  75. showGraphicsDropDown = false;
  76. }
  77. }
  78.  
  79. //Make quit game button
  80. if (GUI.Button (Rect (Screen.width / 2 - 100, Screen.height / 2 - -250, 200, 50), "Quitter le jeu")){
  81. Application.Quit();
  82. }
  83. }
  84. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement