Exemplo n.º 1
0
 // Init
 //------------------------------------------------------------------
 public void Init(apEditor editor, object loadKey, FUNC_NEW_PORTRAIT_RESULT funcResult)
 {
     _editor          = editor;
     _loadKey         = loadKey;
     _funcResult      = funcResult;
     _newPortraitName = "New Portrait";
 }
Exemplo n.º 2
0
        // Show Window
        //------------------------------------------------------------------
        public static object ShowDialog(apEditor editor, FUNC_NEW_PORTRAIT_RESULT funcResult)
        {
            CloseDialog();

            if (editor == null)
            {
                return(null);
            }

            EditorWindow         curWindow = EditorWindow.GetWindow(typeof(apDialog_NewPortrait), true, "Make New Portrait", true);
            apDialog_NewPortrait curTool   = curWindow as apDialog_NewPortrait;

            object loadKey = new object();

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

                return(loadKey);
            }
            else
            {
                return(null);
            }
        }