예제 #1
0
        public static void Update()
        {
            if (Input.GetMouseButtonDown(0) && IsHoverTrigger() && CurrentStyle == Win32Export.WStyle.NORMAL)
            {
                _drag = true;
            }
            else if (Input.GetMouseButtonUp(0))
            {
                _drag = false;
            }

            if (_drag)
            {
                var dx = Input.mousePosition.x - _mouseX;
                var dy = Input.mousePosition.y - _mouseY;
                Win32Export.RECT wndRect = Win32Export.GetWndRect(_hWnd);
                float            x       = wndRect.left;
                x += dx;
                float y = wndRect.top;
                y -= dy;
                var width  = wndRect.right - wndRect.left;
                var height = wndRect.bottom - wndRect.top;
                if (!Application.isEditor)
                {
                    Win32Export.MoveWindow(_hWnd, (int)x, (int)y, width, height, true);
                }
                _mouseX = Input.mousePosition.x - dx;
                _mouseY = Input.mousePosition.y - dy;
                return;
            }
            _mouseX = Input.mousePosition.x;
            _mouseY = Input.mousePosition.y;
        }
예제 #2
0
        private static void GetNormalSize(ref int x, ref int y, ref int w, ref int h)
        {
            Win32Export.RECT wndRect = Win32Export.GetWndRect(_hWnd);
            //Win32Export.RECT workArea = Win32Export.GetWorkArea(Win32Export.NewPoint(wndRect.left, wndRect.top));
            var dx = wndRect.left;
            var dy = wndRect.top;
            var dw = wndRect.right - wndRect.left;
            var dh = wndRect.bottom - wndRect.top;

            w = PlayerPrefs.GetInt("Screenmanager Resolution Width", dw);
            h = PlayerPrefs.GetInt("Screenmanager Resolution Height", dh);
        }
예제 #3
0
        private static void SetNormalSize()
        {
            Win32Export.RECT wndRect = Win32Export.GetWndRect(_hWnd);
            //Win32Export.RECT workArea = Win32Export.GetWorkArea(Win32Export.NewPoint(wndRect.left, wndRect.top));
            var x = wndRect.left;
            var y = wndRect.top;
            var w = wndRect.right - wndRect.left;
            var h = wndRect.bottom - wndRect.top;

            PlayerPrefs.SetInt("Screenmanager Resolution Width", w);
            PlayerPrefs.SetInt("Screenmanager Resolution Height", h);
        }