Example #1
0
 public static void CloseDialog()
 {
     if (s_window != null)
     {
         try
         {
             s_window.Close();
         }
         catch (Exception ex)
         {
             Debug.LogError("Close Exception : " + ex);
         }
         s_window = null;
     }
 }
Example #2
0
        //private Vector2 _scroll = Vector2.zero;

        // Show Window
        //------------------------------------------------------------------
        public static void ShowDialog(apEditor editor, apPortrait portrait)
        {
            CloseDialog();

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

            EditorWindow          curWindow = EditorWindow.GetWindow(typeof(apDialog_OnionSetting), true, "Onion Setting", true);
            apDialog_OnionSetting curTool   = curWindow as apDialog_OnionSetting;

            if (curTool != null && curTool != s_window)
            {
                int width  = 350;
                int height = 570;
                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);
            }
        }