Exemplo n.º 1
0
 public void OnGUI()
 {
     mainGUI = GUI.Window(mainGUID, mainGUI, mainWindow, "Weather Data~");
     if (showOverlayWindow)
     {
         overlayGUI = GUI.Window(overlayGUID, overlayGUI, overlayWindow, "Overlay~");
     }
 }
Exemplo n.º 2
0
        private void OnGUI()
        {
            GUISkin skin    = GUI.skin;
            GUISkin gUISkin = ScriptableObject.CreateInstance("GUISkin") as GUISkin;

            gUISkin.box.normal.background    = (Texture2D)Resources.GetBuiltinResource(typeof(Texture2D), "GameSkin/box.png");
            gUISkin.box.normal.textColor     = new Color(0.9f, 0.9f, 0.9f, 1f);
            gUISkin.box.padding.left         = 6;
            gUISkin.box.padding.right        = 6;
            gUISkin.box.padding.top          = 4;
            gUISkin.box.padding.bottom       = 4;
            gUISkin.box.border.left          = 6;
            gUISkin.box.border.right         = 6;
            gUISkin.box.border.top           = 6;
            gUISkin.box.border.bottom        = 6;
            gUISkin.box.margin.left          = 4;
            gUISkin.box.margin.right         = 4;
            gUISkin.box.margin.top           = 4;
            gUISkin.box.margin.bottom        = 4;
            gUISkin.button.normal.background = (Texture2D)Resources.GetBuiltinResource(typeof(Texture2D), "GameSkin/button.png");
            gUISkin.button.normal.textColor  = new Color(0.9f, 0.9f, 0.9f, 1f);
            gUISkin.button.hover.background  = (Texture2D)Resources.GetBuiltinResource(typeof(Texture2D), "GameSkin/button hover.png");
            gUISkin.button.hover.textColor   = Color.white;
            gUISkin.button.active.background = (Texture2D)Resources.GetBuiltinResource(typeof(Texture2D), "GameSkin/button active.png");
            gUISkin.button.active.textColor  = new Color(0.9f, 0.9f, 0.9f, 1f);
            gUISkin.button.border.left       = 6;
            gUISkin.button.border.right      = 6;
            gUISkin.button.border.top        = 6;
            gUISkin.button.border.bottom     = 6;
            gUISkin.button.padding.left      = 8;
            gUISkin.button.padding.right     = 8;
            gUISkin.button.padding.top       = 4;
            gUISkin.button.padding.bottom    = 4;
            gUISkin.button.margin.left       = 4;
            gUISkin.button.margin.right      = 4;
            gUISkin.button.margin.top        = 4;
            gUISkin.button.margin.bottom     = 4;
            gUISkin.label.normal.textColor   = new Color(0.9f, 0.9f, 0.9f, 1f);
            gUISkin.label.padding.left       = 6;
            gUISkin.label.padding.right      = 6;
            gUISkin.label.padding.top        = 4;
            gUISkin.label.padding.bottom     = 4;
            gUISkin.label.margin.left        = 4;
            gUISkin.label.margin.right       = 4;
            gUISkin.label.margin.top         = 4;
            gUISkin.label.margin.bottom      = 4;
            gUISkin.label.alignment          = TextAnchor.UpperLeft;
            gUISkin.window.normal.background = (Texture2D)Resources.GetBuiltinResource(typeof(Texture2D), "GameSkin/window.png");
            gUISkin.window.normal.textColor  = Color.white;
            gUISkin.window.border.left       = 8;
            gUISkin.window.border.right      = 8;
            gUISkin.window.border.top        = 18;
            gUISkin.window.border.bottom     = 8;
            gUISkin.window.padding.left      = 8;
            gUISkin.window.padding.right     = 8;
            gUISkin.window.padding.top       = 20;
            gUISkin.window.padding.bottom    = 5;
            gUISkin.window.alignment         = TextAnchor.UpperCenter;
            gUISkin.window.contentOffset     = new Vector2(0f, -18f);
            GUI.skin        = gUISkin;
            this.windowRect = GUI.Window(0, this.windowRect, new GUI.WindowFunction(this.DoUserAuthorizationDialog), "Unity Web Player Authorization Request");
            GUI.skin        = skin;
        }
 private void OnGUI()
 {
     this.windowRect = this.win_style is null
                         ? UGUI.Window(this.window_id, this.windowRect, WindowFunc, this.title)
                         : UGUI.Window(this.window_id, this.windowRect, WindowFunc, this.title, this.win_style);
 }
Exemplo n.º 4
0
 private static Rect DoWindow(int id, Rect screenRect, GUI.WindowFunction func, GUIContent content, GUIStyle style, GUILayoutOption[] options)
 {
     GUIUtility.CheckOnGUI();
     GUILayout.LayoutedWindow @object = new GUILayout.LayoutedWindow(func, screenRect, content, options, style);
     return(GUI.Window(id, screenRect, new GUI.WindowFunction(@object.DoWindow), content, style));
 }