void OnLostFocus() { if (window != null) { window.Close(); window = null; } }
static public void ShowWindow(Vector2 position, DataChanged method, object obj) { if (window != null) { window.Close(); window = null; } window = (CurvedWorldMaterialDuplicateEditorWindow)CurvedWorldMaterialDuplicateEditorWindow.CreateInstance(typeof(CurvedWorldMaterialDuplicateEditorWindow)); window.titleContent = new GUIContent("Duplicate Material"); callback = method; objMaterial = obj; window.minSize = windowResolution; window.maxSize = windowResolution; window.ShowUtility(); window.position = new Rect(position.x, position.y, windowResolution.x, windowResolution.y); }