Esempio n. 1
0
 public override void OnGUI()
 {
     ATGUILib.CardLayout(m_iID_CardLayout, ATGUILib.BrightBlue,
                         new ATGUILib.Card(m_iID_Update, "更新", Draw_SVNUpdate),
                         new ATGUILib.Card(m_iID_Commit, "提交", Draw_SVNCommit),
                         new ATGUILib.Card(m_iID_Resolve, "解决", Draw_SVNResolve));
 }
Esempio n. 2
0
    private void Draw_SVNUpdate()
    {
        bool bChanged = false;

        m_stkRm.Clear();

        GUILayout.BeginVertical(EditorStyles.objectFieldThumb);
        for (int i = 0; i < m_lsUpdatePath.Count; ++i)
        {
            string s = m_lsUpdatePath[i].m_sPath;
            GUILayout.BeginVertical(EditorStyles.objectFieldThumb);

            GUILayout.BeginHorizontal();
            ATGUILib.ChangeableButton("更新", !string.IsNullOrEmpty(m_lsUpdatePath[i].m_sPath), a => SVNUpdate((string)a), m_lsUpdatePath[i].m_sPath, 40);
            EditorGUI.BeginChangeCheck();
            GUI.contentColor = ATGUILib.EnhanceColor(Color.green);
            m_lsUpdatePath[i].m_sDescribe = EditorGUILayout.TextField(m_lsUpdatePath[i].m_sDescribe);
            GUI.contentColor = Color.white;
            if (EditorGUI.EndChangeCheck())
            {
                bChanged = true;
            }
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            if (ATGUILib.PathBar("更新目录", ATHelper_File.CorrectPath(ATDefine.Path_Project + "/.."), ref s, "", 190, true, false))
            {
                m_lsUpdatePath[i].m_sPath = s;
                bChanged = true;
            }
            if (GUILayout.Button("-", EditorStyles.miniButton))
            {
                bChanged = true;
                m_stkRm.Push(i);
            }
            GUILayout.EndHorizontal();
            GUILayout.EndVertical();
            GUILayout.Space(5);
        }

        for (int i = 0; i < m_stkRm.Count; ++i)
        {
            m_lsUpdatePath.RemoveAt(m_stkRm.Pop());
        }
        if (bChanged)
        {
            SetConfig <string>(c_sConfig_UpdatePath, CombinePath(m_lsUpdatePath));
        }
        GUILayout.Space(10);
        if (GUILayout.Button("新增地址"))
        {
            m_lsUpdatePath.Add(new PathDescribe("", "---设置更新目录备注---"));
        }
        GUILayout.EndVertical();

        EditorGUILayout.TextArea(sInfo);
    }
 void Draw_Card(ToolType eToolType)
 {
     foreach (var tool in m_lsATs.Where(t => t.m_eToolType == eToolType))
     {
         m_kCurProcessTool = tool;
         ATGUILib.ExpandableUIGroup(m_dicATID[tool], tool.m_sToolName, OnToolExpand, OnToolChangeState, tool.m_bDirctOpen);
         GUILayout.Space(5);
     }
 }
 void OnDisable()
 {
     foreach (var tool in m_lsATs)
     {
         if (ATGUILib.UIGroupExpanded(m_dicATID[tool]))
         {
             tool.OnDisable();
         }
     }
     EditorApplication.update -= OnUpdate;
 }
 void OnGUI()
 {
     if (GUILayout.Button("重新载入工具集"))
     {
         Init();
     }
     ATGUILib.CardLayout(m_iID_CardLayout, ATGUILib.LightOrange,
                         new ATGUILib.Card(m_iID_WorkFlow, "工作流", Draw_WorkFlowTools),
                         new ATGUILib.Card(m_iID_GameDebugger, "游戏调试", Draw_GameDebugerTools),
                         new ATGUILib.Card(m_iID_ExtendTools, "拓展工具", Draw_ExtendTools));
 }
 void OnEnable()
 {
     if (!m_bInited)
     {
         Init();
     }
     foreach (var tool in m_lsATs)
     {
         if (ATGUILib.UIGroupExpanded(m_dicATID[tool]))
         {
             tool.OnEnable();
         }
     }
     EditorApplication.update += OnUpdate;
 }
    public override void OnGUI()
    {
        if (string.IsNullOrEmpty(Path_Unity) || !new DirectoryInfo(Path_Assemblies).Exists)
        {
            string sPath = "";
            if (ATGUILib.PathBar("设置Unity路径", "", ref sPath, "", 130, true))
            {
                if (sPath.EndsWith("Editor"))
                {
                    Path_Assemblies = ATHelper_File.CorrectPath(Path.Combine(sPath, InnerPath_Managed));
                    if (new DirectoryInfo(Path_Assemblies).Exists)
                    {
                        Path_Unity = sPath;
                        SetConfig <string>(Config_UnityPath, sPath);
                    }
                    else
                    {
                        Path_Assemblies = "";
                    }
                }
            }
            return;
        }


        GUI.backgroundColor = ATGUILib.EnhanceColor(ATGUILib.LightBlue);
        EditorGUI.BeginChangeCheck();
        m_sInfo             = EditorGUILayout.TextArea(m_sInfo, GUILayout.Height(400));
        GUI.backgroundColor = Color.white;
        if (EditorGUI.EndChangeCheck())
        {
            m_kCompileResult = null;
        }

        GUILayout.Space(10);

        EditorGUILayout.TextArea(GetInfo(), GUILayout.Height(200));

        GUILayout.Space(10);

        GUILayout.BeginHorizontal();
        ATGUILib.ChangeableButton("编译", m_kCompileResult == null, Complile);
        ATGUILib.ChangeableButton("运行", m_kCompileResult != null && !m_kCompileResult.Errors.HasErrors, Run);
        GUILayout.EndHorizontal();
    }
    void Init()
    {
        titleContent = ATGUILib.GetGUIContent(ATHelper_File.FindFileInAT(m_sIcon).FullName, "辅助工具集");
        m_bInited    = true;
        m_lsATs.Clear();

        m_dicATID.Clear();
        var types = ATHelper_Unity.Assembly_GameEditor.GetTypes().Where(t => t.IsSubclassOf(typeof(AT_Component_Base)));

        foreach (var t in types)
        {
            var tool = System.Activator.CreateInstance(t) as AT_Component_Base;
            m_lsATs.Add(tool);
            m_dicATID[tool]     = ATGUILib.GenerateGroupID();
            m_dicATInited[tool] = false;
        }
        m_lsATs.Sort((a, b) => a.m_iSortValue.CompareTo(b.m_iSortValue));
    }
    void Init()
    {
        titleContent = ATGUILib.GetGUIContent(ATHelper_File.FindFileInAT(m_sIcon).FullName, "辅助工具集");
        m_bInited    = true;
        m_lsATs.Clear();

        var types = ATHelper_Unity.Assembly_GameEditor.GetTypes().Where(t => t.IsSubclassOf(typeof(AT_Component_Base)));

        foreach (var t in types)
        {
            var tool = System.Activator.CreateInstance(t) as AT_Component_Base;
            m_lsATs.Add(tool);
        }
        m_lsATs.Sort((a, b) => a.m_iSortValue.CompareTo(b.m_iSortValue));

        Config = ATHelper_Xml.OpenXml(c_sPreference);
        bool bUseGUI = false;

        Config.GetConfig(c_sUseGUI, ref bUseGUI);
        UseGUI  = bUseGUI;
        minSize = new Vector2(300, 200);
    }
Esempio n. 10
0
    public override void OnGUI()
    {
        if (ATGUILib.PathBar("选择你的服务器文件", ATHelper_File.CorrectPath(sr_sBatPath), ref m_sServerPath, "bat"))
        {
            SetConfig <string>(c_sConfig_ServerPath, m_sServerPath);
        }

        GUILayout.BeginHorizontal(EditorStyles.objectFieldThumb);
        if (m_kProcess != null && m_kProcess.HasExited)
        {
            m_kProcess = null;
        }

        if (ATHelper_File.IsFileExists(m_sServerPath, ".bat") && m_kProcess == null)
        {
            if (GUILayout.Button("启动", GUILayout.Width(50)))
            {
                m_kProcess = ATHelper_Process.RunBat(m_sServerPath);
            }
        }
        else
        {
            GUILayout.Label("   启动", GUILayout.Width(50));
        }

        if (m_kProcess != null)
        {
            if (GUILayout.Button("停止", GUILayout.Width(50)))
            {
                ATHelper_Process.KillProcessTree(m_kProcess);
            }
        }
        else
        {
            GUILayout.Label("   停止", GUILayout.Width(50));
        }
        GUILayout.EndHorizontal();
    }
Esempio n. 11
0
    public override void OnGUI()
    {
        GUILayout.Space(5);
        GUILayout.BeginHorizontal(EditorStyles.objectFieldThumb);
        if (GUILayout.Button("更新DB", GUILayout.Width(70)))
        {
            UpdateDB();
        }
        GUILayout.Space(5);
        ATGUILib.SearchBar(m_id_SearchBar, _searchFunc);
        GUILayout.EndHorizontal();
        GUILayout.Space(5);

        if (m_lsSelectedCSV.Count == 0)
        {
            return;
        }
        ATGUILib.GridLayout(m_lsSelectedCSV.Count, 120, 10, 5, (a, b, c) =>
        {
            int index    = m_lsSelectedCSV[a];
            string sName = m_lsCSVFile[index].Name;
            ATGUILib.EasyButton(sName.Substring(0, sName.Length - 4), _openCSV, index, EditorStyles.boldLabel, c);
        });
    }
    public override void OnGUI()
    {
        i = EditorGUILayout.IntField(i);

        sInfo = EditorGUILayout.TextArea(sInfo);
        if (GUILayout.Button("显示"))
        {
            ATUtils_WinAPI.ShowWindow(new IntPtr(i), 3);
        }

        if (GUILayout.Button("隐藏"))
        {
            ATUtils_WinAPI.ShowWindow(new IntPtr(i), 2);
        }

        if (GUILayout.Button("捕获ListView文本"))
        {
            var e = new ATUtils_WinAPI.ListViewCatecher.ListView();
            ATUtils_WinAPI.ListViewCatecher.DoCatch(i, e);
            foreach (var k in e.Items)
            {
                foreach (var d in k)
                {
                    UnityEngine.Debug.LogError(d);
                }
            }
        }

        if (GUILayout.Button("窗口位置"))
        {
            ATUtils_WinAPI.RECT rect = new ATUtils_WinAPI.RECT();
            ATUtils_WinAPI.GetWindowRect(i, ref rect);
            UnityEngine.Debug.LogError("L:" + rect.Left + " R:" + rect.Right + " T:" + rect.Top + " :B" + rect.Bottom);
        }

        if (GUILayout.Button("发送信息"))
        {
            ATUtils_WinAPI.SendMsg2Window(new IntPtr(i), sInfo);
        }
        if (GUILayout.Button("模拟按键"))
        {
            for (int index = 0; index < sInfo.Length; ++index)
            {
                ATUtils_WinAPI.SendMessage((IntPtr)i, ATUtils_WinAPI.WM_CHAR, sInfo[index], 0);
            }
        }

        using (var h = new ATGUILib.H())
        {
            ATGUILib.ChangeableButton("开始监听按键", !m_blisten, a =>
            {
                hook = new ATUtils_WinAPI.KeyboardHook();
                hook.KeyDownEvent += (x, y) => UnityEngine.Debug.LogError("KeyDown:" + (char)y.KeyCode);
                //hook.KeyPressEvent += (x, y) => UnityEngine.Debug.LogError("KeyPress" + y.KeyCode);
                hook.KeyUpEvent += (x, y) => UnityEngine.Debug.LogError("KeyUp:" + (char)y.KeyCode);
                hook.Start();
                m_blisten = true;
            }
                                      );

            ATGUILib.ChangeableButton("停止监听按键", m_blisten, a =>
            {
                hook.Stop();
                m_blisten = false;
            }
                                      );
        }
    }
    public override void OnGUI()
    {
        GUILayout.BeginHorizontal(EditorStyles.objectFieldThumb);

        GUILayout.BeginHorizontal(EditorStyles.miniButton);
        bool bRefind = false;

        EditorGUI.BeginChangeCheck();
        EditorGUILayout.LabelField("类型:", GUILayout.Width(35));
        m_iSelected = EditorGUILayout.Popup(m_iSelected, m_lsType, GUILayout.Width(70));
        if (EditorGUI.EndChangeCheck())
        {
            m_sFinalType = m_lsType[m_iSelected];
            bRefind      = true;
        }

        EditorGUI.BeginChangeCheck();
        m_sFinalType = EditorGUILayout.TextField(m_sFinalType);
        GUILayout.EndHorizontal();

        GUILayout.Space(3);

        GUILayout.BeginHorizontal(EditorStyles.miniButton);
        EditorGUILayout.LabelField("关键字:", GUILayout.Width(45));
        m_sName = EditorGUILayout.TextField(m_sName);
        GUILayout.EndHorizontal();

        if (EditorGUI.EndChangeCheck())
        {
            bRefind = true;
        }

        GUILayout.Space(3);
        GUILayout.BeginHorizontal(EditorStyles.miniButton);
        if (GUILayout.Button("检索", EditorStyles.toolbarButton, GUILayout.Width(60)))
        {
            bRefind = true;
        }
        GUILayout.Space(3);
        if (GUILayout.Button("重置", EditorStyles.toolbarButton, GUILayout.Width(60)))
        {
            bRefind = false;
            _reset();
        }
        GUILayout.EndHorizontal();
        GUILayout.EndHorizontal();

        if (bRefind)
        {
            m_lsSelectedObj = ATHelper_Unity.GetAllGameObject();
            if (m_sFinalType != m_lsType[0])
            {
                var lst   = ATHelper_Unity.Assembly_GameRuntime.GetTypes().Where(t => t.IsSubclassOf(typeof(MonoBehaviour)));
                var eType = lst.Where(a => a.Name == m_sFinalType).FirstOrDefault();
                if (eType != null)
                {
                    m_lsSelectedObj.RemoveAll(a => a.GetComponent(eType) == null);
                }
                else
                {
                    m_lsSelectedObj.Clear();
                }
            }
            if (!string.IsNullOrEmpty(m_sName))
            {
                m_lsSelectedObj.RemoveAll(a => !a.name.Contains(m_sName));
            }
        }
        if (m_lsSelectedObj.Count == 1)
        {
            Selection.activeGameObject = m_lsSelectedObj[0];
        }

        if (m_lsSelectedObj.Count > 20)
        {
            GUILayout.Label("定位对象数目太多,请增加过滤条件");
        }
        else
        {
            foreach (var i in m_lsSelectedObj)
            {
                if (i == Selection.activeGameObject)
                {
                    GUI.contentColor = ATGUILib.LightBlue;
                }
                try
                {
                    ATGUILib.EasyButton(i.name, a => { Selection.activeGameObject = a as GameObject; }, i, EditorStyles.boldLabel);
                }
                catch (System.Exception)
                {
                    _reset();
                }
                GUI.contentColor = Color.white;
            }
        }
    }