// Show Window //-------------------------------------------------------------- public static object ShowDialog(apEditor editor, apMeshGroup srcMeshGroup, REQUEST_TARGET requestTarget, FUNC_SELECT_MULTIPLE_OBJECTS funcResult, string positiveBtnText, object savedObject, object exceptObject = null) { CloseDialog(); if (editor == null || editor._portrait == null) { return(null); } string windowName = ""; switch (requestTarget) { case REQUEST_TARGET.Mesh: windowName = "Select Meshes"; break; case REQUEST_TARGET.MeshAndMeshGroups: windowName = "Meshes and MeshGroups"; break; case REQUEST_TARGET.ChildMeshTransforms: windowName = "Select Child Meshes"; break; } EditorWindow curWindow = EditorWindow.GetWindow(typeof(apDialog_SelectMultipleObjects), true, windowName, true); apDialog_SelectMultipleObjects curTool = curWindow as apDialog_SelectMultipleObjects; object loadKey = new object(); if (curTool != null && curTool != s_window) { int width = 350; int height = 600; s_window = curTool; s_window.position = new Rect((editor.position.xMin + editor.position.xMax) / 2 - (width / 2), (editor.position.yMin + editor.position.yMax) / 2 - (height / 2), width, height); s_window.Init(editor, loadKey, srcMeshGroup, requestTarget, funcResult, positiveBtnText, savedObject, exceptObject); return(loadKey); } else { return(null); } }
private static void CloseDialog() { if (s_window != null) { try { s_window.Close(); } catch (Exception ex) { Debug.LogError("Close Exception : " + ex); } s_window = null; } }