Beispiel #1
0
        void Present_Explorer()
        {
            EditorGUILayout.BeginVertical(VerticalStyle);
            if (BuildLocalConfig.Ins.Fold_Present_Explorer = EditorGUILayout.Foldout(BuildLocalConfig.Ins.Fold_Present_Explorer, "链接", true))
            {
                EditorGUILayout.LabelField(Application.persistentDataPath);
                EditorGUILayout.BeginHorizontal();
                if (GUILayout.Button("Persistent"))
                {
                    BaseFileUtils.OpenExplorer(Application.persistentDataPath);
                }
                else if (GUILayout.Button("删除 Persistent"))
                {
                    BaseFileUtils.DeletePath(Application.persistentDataPath);
                }
                EditorGUILayout.EndHorizontal();
                EditorGUILayout.BeginHorizontal();
                if (GUILayout.Button("Project File"))
                {
                    BaseFileUtils.OpenExplorer(BaseConstMgr.Path_Project);
                }
                else if (GUILayout.Button("Bin"))
                {
                    BaseFileUtils.OpenExplorer(BaseConstMgr.Path_Build);
                }
                EditorGUILayout.EndHorizontal();

                EditorGUILayout.BeginHorizontal();
                OnDrawPresentExplorer();
                EditorGUILayout.EndHorizontal();
            }
            EditorGUILayout.EndVertical();
        }
Beispiel #2
0
        void Present_ExpressSetup()
        {
            EditorGUILayout.BeginVertical(VerticalStyle);
            if (BuildLocalConfig.Ins.Fold_Present_ExpressSetup = EditorGUILayout.Foldout(BuildLocalConfig.Ins.Fold_Present_ExpressSetup, "平台", true))
            {
                string path         = BuildConfig.CurDistributionSetupPath;
                Rect   dragAreaRect = new Rect();
                //获得一个长300的框
                dragAreaRect = EditorGUILayout.GetControlRect(/*GUILayout.Width(600)*/ true, 18);
                //将上面的框作为文本输入框
                BuildConfig.CurDistributionSetupPath = EditorGUI.TextField(dragAreaRect, "路径", BuildConfig.CurDistributionSetupPath);

                //如果鼠标正在拖拽中或拖拽结束时,并且鼠标所在位置在文本输入框内
                if ((Event.current.type == EventType.DragUpdated ||
                     Event.current.type == EventType.DragExited) &&
                    dragAreaRect.Contains(Event.current.mousePosition))
                {
                    //改变鼠标的外表
                    DragAndDrop.visualMode = DragAndDropVisualMode.Generic;
                    if (DragAndDrop.paths != null && DragAndDrop.paths.Length > 0)
                    {
                        BuildConfig.CurDistributionSetupPath = DragAndDrop.paths[0];
                    }
                }
                EditorGUILayout.BeginHorizontal();
                if (GUILayout.Button("安装到本地"))
                {
                    if (BuildConfig.CurDistributionSetupPath != null)
                    {
                        BaseFileUtils.DeletePath(BuildConfig.CurDistributionSetupPath);
                        BaseFileUtils.EnsureDirectory(BuildConfig.CurDistributionSetupPath);
                        BaseFileUtils.CopyDir(BuildConfig.DirPath, BuildConfig.CurDistributionSetupPath);
                    }
                }
                if (GUILayout.Button("打开安装目录"))
                {
                    if (BuildConfig.CurDistributionSetupPath != null)
                    {
                        BaseFileUtils.OpenExplorer(BuildConfig.CurDistributionSetupPath);
                    }
                }
                EditorGUILayout.EndHorizontal();

                EditorGUILayout.BeginVertical();
                BuildConfig.Username = EditorGUILayout.TextField("用户名", BuildConfig.Username);
                BuildConfig.Password = EditorGUILayout.PasswordField("密码", BuildConfig.Password);

                EditorGUILayout.BeginHorizontal();
                if (GUILayout.Button("上传"))
                {
                    if (string.IsNullOrEmpty(BuildConfig.Username) || string.IsNullOrEmpty(BuildConfig.Password))
                    {
                        EditorUtility.DisplayDialog("错误", "请先输入用户名密码", "好的");
                    }
                    else
                    {
                        if (EditorUtility.DisplayDialog("重要操作", "确定要上传吗.", "上传", "取消"))
                        {
                            BuildConfig.GetBuildData(BuildConfig.Distribution).Upload();
                        }
                    }
                }

                EditorGUILayout.EndHorizontal();
                EditorGUILayout.EndVertical();
            }
            EditorGUILayout.EndVertical();
        }