protected override void Awake() { #pragma warning disable 0162 base.Awake(); #if UNITY_EDITOR Debug.Log("WindowPositionManager do nothing in editor, and the instance will be Destroyed."); return; #endif _windowHandle = FindWindow(null, Application.productName); if (CommandLineArgs.GetValueAsInt(CommandScreenPositionX, out var x)) { screenPositionX = x; } if (CommandLineArgs.GetValueAsInt(CommandScreenPositionY, out var y)) { screenPositionY = y; } topmost = topmost || CommandLineArgs.HasParameter(CommandTopmost); if (CommandLineArgs.GetValueAsFloat(CommandTopmost, out var time)) { intervalTime = time; } if (topmost && intervalTime >= 0) { SetWindowPosition(_windowHandle, screenPositionX, screenPositionY, topmost); // NOTE: // Once ver. if (intervalTime == 0) { Destroy(this); } } #pragma warning restore 0162 }