void Awake() { if (window != null) { UnityEngine.Debug.LogError("WindowMod duplicated!!!"); return; } window = this; }
private void Awake() { Screen.SetResolution(600, 350, false); //btnSmallScreen.onClick.AddListener(OnFullScreenClick); this.Xscreen = (int)WindowMod.GetSystemMetrics(0); this.Yscreen = (int)WindowMod.GetSystemMetrics(1); // Screen.SetResolution(this.windowWidth, this.windowWidth, false); // this.screenPosition = new Rect((this.Xscreen - (float)this.windowWidth), (this.Yscreen - (float)this.windowHeight), (float)this.windowWidth, (float)this.windowHeight); this.screenPosition = new Rect(0, this.Yscreen - (float)this.windowHeight, this.Xscreen, (float)this.windowHeight); }
private void SwitchFullScreen() { WindowMod.SetWindowLong(WindowMod.GetForegroundWindow(), -16, 369164288); WindowMod.SetWindowPos(WindowMod.GetForegroundWindow(), this.HWND_TOPMOST, (int)this.screenPosition.x, (int)this.screenPosition.y, (int)this.screenPosition.width, (int)this.screenPosition.height, 64u); }