Пример #1
0
    public void OnGUI()
    {
        //GUILayout.Box("", guiLayout.ToArray());
        //GUILayout.BeginArea(new Rect(5, 5, 500, 500));
        area.OnGUIUpdate();
        but.OnGUIUpdate();
        label.OnGUIUpdate();
        space.OnGUIUpdate();
        but.OnGUIUpdate();
        label.OnGUIUpdate();
        popup.OnGUIUpdate();
        text.OnGUIUpdate();
        text.OnGUIUpdate();
        toggle.OnGUIUpdate();
        toggle.OnGUIUpdate();
        toggle.OnGUIUpdate();
        toggle.OnGUIUpdate();
        //GUILayout.EndArea();
        area.EndArea();


        //tempEditor.DrawDefaultInspector();
        //tempEditor.DrawPreview(new Rect(0, 600, 800, 200));

        if (tempEditor != null)
        {
            //tempEditor.OnInspectorGUI();
            //tempEditor.DrawPreview(new Rect(0,700, 800, 200));
            tempEditor.OnInteractivePreviewGUI(new Rect(0, 700, 800, 200), EditorStyles.whiteLabel);
        }

        //D.LogWarning(tempEditor.target.GetType().ToString());
        //         GameObject hero = tempEditor.target as GameObject;
        //         Animation ani = hero.GetComponent<Animation>();
        //
        if (!isFrist)
        {
            isFrist = true;
            //tempEditor.OnInteractivePreviewGUI(new Rect(0, 700, 800, 200), EditorStyles.whiteLabel);
        }
    }
Пример #2
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();
             */
        }