Advertisement
Guest User

Untitled

a guest
Jun 3rd, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var background : Texture2D;
  2. var FontStyle : GUIStyle;
  3.  
  4. var username = "pass";
  5. var userPass = "username";
  6.  
  7. var center : Vector2;
  8. center.x = Screen.width / 2;
  9. center.y = Screen.height / 2;
  10.  
  11. var BackgroundMusic : AudioClip = null;
  12. var BackgroundMusicVolume : float = 0.6;
  13. private var backgroundMusic : AudioSource = null;
  14.  
  15.  
  16. function Awake()
  17. {
  18.     backgroundMusic = gameObject.AddComponent(AudioSource);
  19.     backgroundMusic.loop = true;
  20.     backgroundMusic.playOnAwake = true;
  21.     backgroundMusic.clip = BackgroundMusic;
  22.     backgroundMusic.maxVolume = BackgroundMusicVolume;
  23.     backgroundMusic.minVolume = BackgroundMusicVolume;
  24.     backgroundMusic.volume = BackgroundMusicVolume;
  25.     //audio.PlayOneShot(sound);
  26. }
  27.  
  28.  
  29. function OnGUI(){
  30.         GUI.Box(Rect(center.x / 2,center.y - 123,center.x / 1.01 ,center.y/ 1.8), background); 
  31.        
  32.         GUI.Label (Rect (center.x - 140, center.y -100, 290, 50), "Gear For Speed", FontStyle);
  33.        
  34.         // Username
  35.         userPass = GUI.TextField (Rect ( (center.x / 2 ) + 50, center.y -30, (center.x / 1.01) - 100, 25), userPass, 25 );
  36.        
  37.         // Password
  38.         username = GUI.PasswordField (Rect ( (center.x / 2 ) + 50, center.y + 20, (center.x / 1.01) - 100, 25), username, "*"[0], 25);
  39.        
  40.         // Login BTN
  41.         if(GUI.Button(Rect (center.x - 170, center.y + 65, 64, 25), "Inloggen")){
  42.             Application.LoadLevel ("CompleteScene");
  43.         }
  44.        
  45.         // QUIT BTN
  46.         if(GUI.Button(Rect (center.x + 120, center.y + 65, 75, 25), "Registeren")){
  47.             Application.Quit();
  48.         }
  49.        
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement