Пример #1
0
        private void DrawConfigs()
        {
            using (var hor = new EditorGUILayout.HorizontalScope())
            {
                GUILayout.Label("使用规则: " + "  [psd文件导出 + ui界面生成]");
                exporter.ruleObj = EditorGUILayout.ObjectField(exporter.ruleObj, typeof(RuleObject), false) as RuleObject;
                if (GUILayout.Button("创建", GUILayout.Width(60)))
                {
                    if (EditorUtility.DisplayDialog("创建新规则", "确认后将生成新的规则文件!", "确认", "取消"))
                    {
                        exporter.ruleObj = RuleHelper.CreateRuleObject();
                    }
                }
            }

            if (GUILayout.Button("转换层级为图片,并记录索引", EditorStyles.toolbarButton))
            {
                if (EditorUtility.DisplayDialog("温馨提示", "重新加载目前将重写以下配制,继续请按确认!", "确认"))
                {
                    RecordAllPsdInformation();
                    m_TreeView      = new ExporterTreeView(m_TreeViewState);
                    m_TreeView.root = rootNode;
                }
            }
        }
Пример #2
0
        private void DrawConfigs(Rect configRect)
        {
            var titleRect   = new Rect(configRect.x, configRect.y, configRect.width * 0.1f, configRect.height);
            var contentRect = new Rect(configRect.x + configRect.width * 0.1f, configRect.y, configRect.width * 0.5f, configRect.height);
            var noticeRect  = new Rect(configRect.x + configRect.width * 0.6f, configRect.y, configRect.width * 0.3f, configRect.height);
            var createRect  = new Rect(configRect.x + configRect.width - 60, configRect.y, 60, EditorGUIUtility.singleLineHeight);

            EditorGUI.SelectableLabel(titleRect, "使用规则: ");
            EditorGUI.LabelField(noticeRect, "[psd文件导出 + ui界面生成]");
            ruleObj = EditorGUI.ObjectField(contentRect, ruleObj, typeof(RuleObject), false) as RuleObject;
            if (GUI.Button(createRect, "创建", EditorStyles.miniButtonRight))
            {
                if (EditorUtility.DisplayDialog("创建新规则", "确认后将生成新的规则文件!", "确认", "取消"))
                {
                    exporter.ruleObj = RuleHelper.CreateRuleObject();
                }
            }
        }