// Show Window / Close Dialog
        //------------------------------------------------------------------------
        public static object ShowDialog(apEditor editor, apAnimClip targetAnimClip, FUNC_SELECT_MESHGROUP funcResult)
        {
            CloseDialog();

            if (editor == null || editor._portrait == null || editor._portrait._controller == null)
            {
                return(null);
            }

            EditorWindow curWindow = EditorWindow.GetWindow(typeof(apDialog_SelectLinkedMeshGroup), true, "Select Mesh Group", true);
            apDialog_SelectLinkedMeshGroup curTool = curWindow as apDialog_SelectLinkedMeshGroup;

            object loadKey = new object();

            if (curTool != null && curTool != s_window)
            {
                int width  = 250;
                int height = 400;
                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, targetAnimClip, funcResult);

                return(loadKey);
            }
            else
            {
                return(null);
            }
        }
        // Init
        //------------------------------------------------------------------------
        public void Init(apEditor editor, object loadKey, apAnimClip targetAnimGroup, FUNC_SELECT_MESHGROUP funcResult)
        {
            _editor         = editor;
            _loadKey        = loadKey;
            _funcResult     = funcResult;
            _targetAnimClip = targetAnimGroup;

            _selectedMeshGroup = null;
            _selectableMeshGroups.Clear();

            for (int i = 0; i < _editor._portrait._meshGroups.Count; i++)
            {
                _selectableMeshGroups.Add(_editor._portrait._meshGroups[i]);
            }
        }