版本 unity2018.2.7
[DllImport(“user32.dll”)]
public static extern int SetWindowPos(IntPtr hWnd, int hWndInsertAfter, int x, int y, int Width, int Height, int flags);
[DllImport(“user32.dll”)]
static extern int SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong);
在用这两个方法设置时代码不起作用,需要在打包设置将FullsreeenMode改为Windowed
设置完后,代码起作用
在Unity2018.2.7版本中,使用SetWindowPos和SetWindowLong方法调整窗口位置和大小时,若要使代码生效,需在打包设置中将全屏模式改为窗口模式。
479





