public static void ShowSceneLocator() { if (instance != null) { return; } var window = CreateInstance <SceneLocator>(); instance = window; window.ShowPopup(); var size = new Vector2(300, 300); var center = new Vector2(Screen.currentResolution.width / 2 - size.x / 2, Screen.currentResolution.height / 2 - size.y / 2); window.position = new Rect(center, size); window.Focus(); }
private void OnDestroy() { instance = null; }