版本 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
设置完后,代码起作用