Advertisement
ZeronSix

4Art

Aug 7th, 2013
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.70 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class GameMenu : MonoBehaviour {
  5.     private Rect OptionsRect = new Rect (20,20,120,50);
  6.     private bool showOptionsWindow = false;
  7.  
  8.     void OnGUI ()
  9.     {
  10.         if (GUI.Button (new Rect ( 25,25,100,30), "New Game"))
  11.         {
  12.             Application.LoadLevel ( 2 );
  13.         }
  14.         if (GUI.RepeatButton (new Rect ( 25,70,100,30), "Options"))
  15.             showOptionsWindow = true;
  16.         if (GUI.Button (new Rect ( 25,115,100,30), "Exit"))
  17.         {
  18.             Application.Quit ();
  19.         }
  20.         if (showOptionsWindow)
  21.             OptionsRect = GUI.Window ( 0, OptionsRect, WindowFunction,"Settings Menu");
  22.     }
  23.    
  24.     void WindowFunction ( int windowID )
  25.     {
  26.         // Все что должно быть в меню опции
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement