Пример #1
0
        private SVNSetiingWindows()
        {
            _UpdatePaths.Clear();

            _SVNLabel = HS_Label.Create("SVN_ROOT");
            string svnButName = "请选择SVN ROOT";

            if (PlayerPrefs.HasKey(SVN_ROOT_KEY))
            {
                svnButName = PlayerPrefs.GetString(SVN_ROOT_KEY);
            }
            _SVNPathBut = HS_Button.Create(svnButName, () =>
            {
                string temp = EditorUtility.OpenFolderPanel("选择路径", "", "");
                if (!string.IsNullOrEmpty(temp))
                {
                    _SVNPathBut.Name = temp;
                }
                if (PlayerPrefs.HasKey(SVN_ROOT_KEY))
                {
                    PlayerPrefs.DeleteKey(SVN_ROOT_KEY);
                }
                PlayerPrefs.SetString(SVN_ROOT_KEY, _SVNPathBut.Name);
            });

            ////////////////////////////////////////////////

            _ResSaveLavel = HS_Label.Create("资源保存路径");
            string butResSaveName = "请选择资源保存路径";

            if (PlayerPrefs.HasKey(RES_SAVE_KEY))
            {
                butResSaveName = PlayerPrefs.GetString(RES_SAVE_KEY);
            }
            _ResSaveBut = HS_Button.Create(butResSaveName, () =>
            {
                string temp = EditorUtility.OpenFolderPanel("选择路径", "", "");
                if (!string.IsNullOrEmpty(temp))
                {
                    _ResSaveBut.Name = temp;
                }
                if (PlayerPrefs.HasKey(RES_SAVE_KEY))
                {
                    PlayerPrefs.DeleteKey(RES_SAVE_KEY);
                }
                PlayerPrefs.SetString(RES_SAVE_KEY, _ResSaveBut.Name);
            });


            ///////////////////////////////////////
            RefreshData();
        }
Пример #2
0
    public void Init()
    {
        guiLayout.Add(GUILayout.Width(500));
        guiLayout.Add(GUILayout.Height(500));

        but   = HS_Button.Create("Butten", null);
        label = HS_Label.Create("Lable");
        space = HS_Space.Create(50);
        popup = HS_Popup <HS_Text> .Create("Popup");

        popup.Add(HS_Text.Create("HS_Text1", "郭晓波"));
        popup.Add(HS_Text.Create("HS_Text2", "郭晓波"));
        popup.Add(HS_Text.Create("HS_Text3", "郭晓波"));
        popup.Add(HS_Text.Create("HS_Text4", "郭晓波"));
        popup.Add(HS_Text.Create("HS_Text5", "郭晓波"));
        popup.Add(HS_Text.Create("HS_Text6", "郭晓波"));

        text   = HS_Text.Create("HS_Text", "郭晓波");
        toggle = HS_Toggle.Create("HS_Toggle", false);

        area = HS_Area.Create("L", 500, 500, true);

        tempEditor = Editor.CreateEditor(Selection.objects[0]);
    }
Пример #3
0
        private void OnGUI()
        {
            _SVNArea.OnGUIUpdate();
            GUILayout.BeginHorizontal();
            _SVNLabel.OnGUIUpdate();
            _SVNPathBut.OnGUIUpdate();
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            _ResSaveLavel.OnGUIUpdate();
            _ResSaveBut.OnGUIUpdate();
            GUILayout.EndHorizontal();
            _SVNArea.EndArea();

            HS_Label.Create("需要更新的目录:").OnGUIUpdate();
            HS_GUITool.BeginGroup();
            {
                foreach (string path in UpdatePaths)
                {
                    HS_Label.Create(path).OnGUIUpdate();
                }
            }
            HS_GUITool.EndGroup();


            GUILayout.BeginHorizontal();
            HS_Button.Create("添加目录", () =>
            {
                string temp = EditorUtility.OpenFolderPanel("选择路径", "", "");
                if (!string.IsNullOrEmpty(temp) && !_UpdatePaths.Contains(temp))
                {
                    _UpdatePaths.Add(temp);
                    temp = HS_Base.C2N(temp);
                    if (!PlayerPrefs.HasKey(UPDATE_PATH_LIST_KEY))
                    {
                        PlayerPrefs.SetString(UPDATE_PATH_LIST_KEY, temp);
                    }
                    else
                    {
                        string paths = PlayerPrefs.GetString(UPDATE_PATH_LIST_KEY);
                        paths       += "|" + temp;
                        PlayerPrefs.SetString(UPDATE_PATH_LIST_KEY, paths);
                    }
                }
                PlayerPrefs.Save();
            }).OnGUIUpdate();

            HS_Button.Create("清空目录", () =>
            {
                if (EditorUtility.DisplayDialog("提示", "确定清空目录吗?", "确认", "取消"))
                {
                    _UpdatePaths.Clear();
                    PlayerPrefs.DeleteKey(UPDATE_PATH_LIST_KEY);
                    PlayerPrefs.Save();
                }
            }).OnGUIUpdate();
            GUILayout.EndHorizontal();

            /*
             * HS_Button.Create("测试更新", () =>
             * {
             *  foreach (string p in UpdatePaths)
             *  {
             *      RunCommand(p, SVN_ROOT, " clear", true);
             *      RunCommand(p, SVN_ROOT, " uodate", true);
             *  }
             * }).OnGUIUpdate();
             */
        }