Ejemplo n.º 1
0
        // Show Window
        //------------------------------------------------------------------
        public static object ShowDialog(apEditor editor, apPortrait portrait, FUNC_FFD_SIZE_RESULT funcResult, int curX, int curY)
        {
            CloseDialog();

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

            EditorWindow     curWindow = EditorWindow.GetWindow(typeof(apDialog_FFDSize), true, "Custom FFD Size", true);
            apDialog_FFDSize curTool   = curWindow as apDialog_FFDSize;

            object loadKey = new object();

            if (curTool != null && curTool != s_window)
            {
                int width  = 300;
                int height = 130;
                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, loadKey, funcResult, curX, curY);

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