Beispiel #1
0
        public void Draw(int windowID)
        {
            if (!this.backupRect.HasValue)
            {
                this.backupRect = new Rect?(this.rect);
            }
            if (this.isClose)
            {
                return;
            }
            this.CloseButton();
            GUIDrawer.Window.Type type = this.type;
            // ISSUE: object of a compiler-generated type is created
            // ISSUE: variable of a compiler-generated type
            GUIDrawer.Window.\u003CDraw\u003Ec__AnonStorey0 drawCAnonStorey0 = new GUIDrawer.Window.\u003CDraw\u003Ec__AnonStorey0();
            // ISSUE: reference to a compiler-generated field
            drawCAnonStorey0.\u0024this = this;
            switch (type)
            {
            case GUIDrawer.Window.Type.None:
                this.DoWindow(-1);
                break;

            case GUIDrawer.Window.Type.Normal:
            case GUIDrawer.Window.Type.Layout:
                // ISSUE: reference to a compiler-generated field
                // ISSUE: reference to a compiler-generated method
                drawCAnonStorey0.doWindow = new Action <int>(drawCAnonStorey0.\u003C\u003Em__0);
                if (this.type == GUIDrawer.Window.Type.Normal || this.isHide)
                {
                    if (this.isHide)
                    {
                        ((Rect) ref this.rect).set_height(50f);
                    }
                    // ISSUE: method pointer
                    this.rect = GUI.Window(windowID, this.rect, new GUI.WindowFunction((object)drawCAnonStorey0, __methodptr(\u003C\u003Em__1)), this.title);
                }
                else
                {
                    // ISSUE: method pointer
                    this.rect = GUILayout.Window(windowID, this.rect, new GUI.WindowFunction((object)drawCAnonStorey0, __methodptr(\u003C\u003Em__2)), this.title, (GUILayoutOption[])Array.Empty <GUILayoutOption>());
                }
                this.HideButton();
                break;

            case GUIDrawer.Window.Type.Custom:
                Rect rect = this.rect;
                using (new GUILayout.AreaScope(rect))
                {
                    GUIContent guiContent = new GUIContent(this.title);
                    using (new GUILayout.VerticalScope(GUIStyle.op_Implicit("box"), (GUILayoutOption[])Array.Empty <GUILayoutOption>()))
                    {
                        if (GUILayout.RepeatButton(guiContent, new GUILayoutOption[2]
                        {
                            GUILayout.ExpandWidth(true),
                            GUILayout.ExpandHeight(false)
                        }))
                        {
                            float y = (float)new GUIStyle().CalcSize(guiContent).y;
                            ((Rect) ref this.rect).set_x((float)(Input.get_mousePosition().x - (double)((Rect) ref rect).get_width() * 0.5));
                            ((Rect) ref this.rect).set_y((float)((double)Screen.get_height() - Input.get_mousePosition().y - (double)y * 0.5));
                        }
                        this.DoWindow(-1);
                        break;
                    }
                }
            }
        }
Beispiel #2
0
 public Window()
 {
     this.type         = GUIDrawer.Window.Type.None;
     this.defaultTitle = this.title = string.Empty;
 }