Beispiel #1
0
        public static void SetWindowSize(WindowComponent windowComponent, int width, int height)
        {
            if (width >= 0)
            {
                windowComponent.WindowWidget.width = (int)Mathf.Min(width, MaxWindowSize.x);
            }

            if (height >= 0)
            {
                windowComponent.WindowWidget.height = (int)Mathf.Min(height, MaxWindowSize.y);
            }

            var bounds = GameObjectUtil.GetDragObjectBounds(windowComponent.ControlBar.DragObject);

            windowComponent.ControlBar.DragObject.panelRegion.ConstrainTargetToBounds(windowComponent.transform, ref bounds, true);
        }
Beispiel #2
0
        public static void KeepWindowInsideScreen(WindowComponent windowComponent)
        {
            var bounds = GameObjectUtil.GetDragObjectBounds(windowComponent.ControlBar.DragObject);

            windowComponent.ControlBar.DragObject.panelRegion.ConstrainTargetToBounds(windowComponent.transform, ref bounds, true);
        }