Esempio n. 1
0
        // Show Window / Close Dialog
        //------------------------------------------------------------------------
        public static object ShowDialog(apEditor editor,
                                        apPortrait portrait,
                                        apMeshGroup meshGroup,
                                        apModifierBase modifier,
                                        apModifiedMesh modMesh,
                                        apRenderUnit renderUnit,
                                        bool isAnimEdit,
                                        apAnimClip animClip,
                                        apAnimKeyframe keyframe)
        {
            CloseDialog();

            if (editor == null ||
                editor._portrait == null ||
                meshGroup == null ||
                modifier == null ||
                modMesh == null)
            {
                return(null);
            }



            EditorWindow         curWindow = EditorWindow.GetWindow(typeof(apDialog_ExtraOption), true, "Extra Properties", true);
            apDialog_ExtraOption curTool   = curWindow as apDialog_ExtraOption;

            object loadKey = new object();

            if (curTool != null && curTool != s_window)
            {
                int width = 400;

                int height = 620;
                if (isAnimEdit)
                {
                    height = 715;
                }
                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, portrait, meshGroup, modifier, modMesh, renderUnit, isAnimEdit, animClip, keyframe);

                return(loadKey);
            }
            else
            {
                return(null);
            }
        }
Esempio n. 2
0
        private static void CloseDialog()
        {
            if (s_window != null)
            {
                try
                {
                    s_window.Close();
                }
                catch (Exception ex)
                {
                    Debug.LogError("Close Exception : " + ex);
                }

                s_window = null;
            }
        }