Esempio n. 1
0
 private void OpenLocalMode()
 {
     ClearConsole();
     NetWorkServer.RealClose();
     currentFrameIndex = 0;
     m_TreeView.Clear(true);
     NetWorkServer.UnRegisterReceive();
 }
Esempio n. 2
0
        public ProfilerForm()
        {
            InitializeComponent();
            button1.Enabled = true;
            attachmentColumn.DefaultCellStyle.NullValue = null;

            NetWorkServer.RegisterOnReceiveSample(OnReceiveSample);
            NetWorkServer.BeginListen("0.0.0.0", 2333);
            timer1.Enabled = true;
            boldFont       = new Font(tvTaskList.DefaultCellStyle.Font, FontStyle.Bold);
        }
Esempio n. 3
0
 private void OpenLocalMode()
 {
     ClearConsole();
     NetWorkServer.RealClose();
     currentFrameIndex = 0;
     m_TreeView.Clear(true);
     LuaProfiler.UnRegistReceive();
     NetWorkServer.UnRegisterReceive();
     LuaProfiler.RegisterOnReceiveSample(m_TreeView.LoadRootSample);
     LuaProfiler.RegisterOnReceiveRefInfo(m_luaRefScrollView.DelRefInfo);
     LuaProfiler.RegisterOnReceiveDiffInfo(m_luaDiffScrollView.DelDiffInfo);
 }
Esempio n. 4
0
        static StartUp()
        {
#if UNITY_2017_1_OR_NEWER
            EditorApplication.playModeStateChanged += (state) =>
            {
                if (isPlaying == true && EditorApplication.isPlaying == false)
                {
                    NetWorkServer.Close();
                }

                isPlaying = EditorApplication.isPlaying;
            };
#else
            EditorApplication.playmodeStateChanged += () =>
            {
                if (isPlaying == true && EditorApplication.isPlaying == false)
                {
                    NetWorkServer.RealClose();
                }

                isPlaying = EditorApplication.isPlaying;
            };
#endif
        }
Esempio n. 5
0
        void DoRecord()
        {
            var instance = LuaDeepProfilerSetting.Instance;

            if (!instance.isRecord)
            {
                return;
            }

            EditorGUILayout.BeginHorizontal(EditorStyles.toolbar);

            bool state = instance.isStartRecord;

            instance.isStartRecord = GUILayout.Toggle(instance.isStartRecord, "StartRecord", EditorStyles.toolbarButton, GUILayout.Height(30));

            if (!state && instance.isStartRecord)
            {
                m_TreeView.Clear(true);
                m_luaRefScrollView.ClearRefInfo(true);
                NetWorkServer.SendCmd(0);
            }

            if (state && !instance.isStartRecord)
            {
                m_TreeView.LoadHistoryCurve();
            }

            int count = m_TreeView.history.Count - 1;
            int delta = Mathf.Max(0, count - m_lastCount);

            if (delta != 0)
            {
                endFrame = count;
            }

            int oldStartFrame = startFrame;

            GUILayout.Label("start", EditorStyles.toolbarButton, GUILayout.Height(30), GUILayout.Width(45));
            startFrame = EditorGUILayout.IntSlider(startFrame, 0, count, GUILayout.Width(150));
            if (GUILayout.Button("<< ", EditorStyles.toolbarButton, GUILayout.Height(30), GUILayout.Width(30)))
            {
                startFrame = m_TreeView.GetPreProgramFrame(startFrame);
                endFrame   = startFrame;
            }
            if (GUILayout.Button("< ", EditorStyles.toolbarButton, GUILayout.Height(30), GUILayout.Width(30)))
            {
                startFrame = Mathf.Max(startFrame - 1, 0);
            }
            if (GUILayout.Button(" >", EditorStyles.toolbarButton, GUILayout.Height(30), GUILayout.Width(30)))
            {
                startFrame = Mathf.Min(startFrame + 1, count);
            }
            if (GUILayout.Button(" >>", EditorStyles.toolbarButton, GUILayout.Height(30), GUILayout.Width(30)))
            {
                startFrame = m_TreeView.GetNextProgramFrame(startFrame);
                endFrame   = startFrame;
            }

            int oldEndFrame = endFrame;

            GUILayout.Space(15);

            GUILayout.Label("end", EditorStyles.toolbarButton, GUILayout.Height(30), GUILayout.Width(45));
            endFrame = EditorGUILayout.IntSlider(endFrame, 0, count, GUILayout.Width(150));

            if (GUILayout.Button("<< ", EditorStyles.toolbarButton, GUILayout.Height(30), GUILayout.Width(30)))
            {
                endFrame   = m_TreeView.GetPreProgramFrame(endFrame);
                startFrame = endFrame;
            }
            if (GUILayout.Button("< ", EditorStyles.toolbarButton, GUILayout.Height(30), GUILayout.Width(30)))
            {
                endFrame = Mathf.Max(endFrame - 1, 0);
            }
            if (GUILayout.Button(" >", EditorStyles.toolbarButton, GUILayout.Height(30), GUILayout.Width(30)))
            {
                endFrame = Mathf.Min(endFrame + 1, count);
            }
            if (GUILayout.Button(" >>", EditorStyles.toolbarButton, GUILayout.Height(30), GUILayout.Width(30)))
            {
                endFrame   = m_TreeView.GetNextProgramFrame(endFrame);
                startFrame = endFrame;
            }

            GUILayout.Space(25);
            GUILayout.Label("capture lua gc", EditorStyles.toolbarButton, GUILayout.Height(30), GUILayout.Width(80));
            LuaDeepProfilerSetting.Instance.captureLuaGC
                = EditorGUILayout.IntField(LuaDeepProfilerSetting.Instance.captureLuaGC, GUILayout.Height(16), GUILayout.Width(50));
            LuaDeepProfilerSetting.Instance.captureLuaGC = Mathf.Max(0, LuaDeepProfilerSetting.Instance.captureLuaGC);

            GUILayout.Label("capture mono gc", EditorStyles.toolbarButton, GUILayout.Height(30), GUILayout.Width(100));
            LuaDeepProfilerSetting.Instance.captureMonoGC
                = EditorGUILayout.IntField(LuaDeepProfilerSetting.Instance.captureMonoGC, GUILayout.Height(16), GUILayout.Width(50));
            LuaDeepProfilerSetting.Instance.captureMonoGC = Mathf.Max(0, LuaDeepProfilerSetting.Instance.captureMonoGC);

            GUILayout.Label("capture frame rate", EditorStyles.toolbarButton, GUILayout.Height(30), GUILayout.Width(100));
            LuaDeepProfilerSetting.Instance.captureFrameRate
                = EditorGUILayout.IntField(LuaDeepProfilerSetting.Instance.captureFrameRate, GUILayout.Height(16), GUILayout.Width(40));
            LuaDeepProfilerSetting.Instance.captureFrameRate = Mathf.Max(0, LuaDeepProfilerSetting.Instance.captureFrameRate);
            m_lastCount = count;

            GUILayout.Space(25);
            GUILayout.FlexibleSpace();

            if (oldStartFrame != startFrame || oldEndFrame != endFrame)
            {
                m_TreeView.ReLoadSamples(startFrame, endFrame);

                int startGameFrame = m_TreeView.GetFrameCount(startFrame);
                int endGameFrame   = m_TreeView.GetFrameCount(endFrame);
                m_luaRefScrollView.LoadHistory(startGameFrame, endGameFrame);
                if (EditorApplication.isPlaying)
                {
                    EditorApplication.isPaused = true;
                }
            }

            bool isSave = GUILayout.Button("Save", EditorStyles.toolbarButton, GUILayout.Height(30), GUILayout.Width(50));

            if (isSave)
            {
                m_TreeView.SaveHisotry();
            }

            bool isLoad = GUILayout.Button("Load", EditorStyles.toolbarButton, GUILayout.Height(30), GUILayout.Width(50));

            if (isLoad)
            {
                m_TreeView.LoadHistory();
            }

            GUILayout.Space(10);
            EditorGUILayout.EndHorizontal();
        }
Esempio n. 6
0
        void DoToolbar()
        {
            EditorGUILayout.BeginHorizontal(EditorStyles.toolbar);

            #region clear
            bool isClear = GUILayout.Button("Clear", EditorStyles.toolbarButton, GUILayout.Height(30));
            if (isClear)
            {
                currentFrameIndex = 0;
                m_TreeView.Clear(true);
                m_luaRefScrollView.ClearRefInfo(true);
                m_luaDiffScrollView.Clear();
            }
            GUILayout.Space(5);
            #endregion

            #region history
            bool flag = GUILayout.Toggle(LuaDeepProfilerSetting.Instance.isRecord, "Record", EditorStyles.toolbarButton, GUILayout.Height(30));
            if (flag != LuaDeepProfilerSetting.Instance.isRecord)
            {
                LuaDeepProfilerSetting.Instance.isRecord = flag;
            }
            GUILayout.Space(25);
            #endregion

            #region socket

            if (GUILayout.Button("OpenService", EditorStyles.toolbarButton, GUILayout.Height(30)))
            {
                NetWorkServer.Close();
                currentFrameIndex = 0;
                m_TreeView.Clear(true);
                NetWorkServer.RegisterOnReceiveSample(m_TreeView.LoadRootSample);
                NetWorkServer.RegisterOnReceiveRefInfo(m_luaRefScrollView.DelRefInfo);
                NetWorkServer.RegisterOnReceiveDiffInfo(m_luaDiffScrollView.DelDiffInfo);
                NetWorkServer.BeginListen("0.0.0.0", port);
            }
            GUILayout.Label("port:", GUILayout.Height(30), GUILayout.Width(35));
            port = EditorGUILayout.IntField(port, GUILayout.Height(16), GUILayout.Width(50));

            if (GUILayout.Button("CloseService", EditorStyles.toolbarButton, GUILayout.Height(30)))
            {
                NetWorkServer.Close();
            }

            GUILayout.Space(25);
            if (GUILayout.Button("MarkLuaRecord", EditorStyles.toolbarButton, GUILayout.Height(30)))
            {
                NetWorkServer.SendCmd(1);
                m_luaDiffScrollView.MarkIsRecord();
            }
            if (GUILayout.Button("DiffRecord", EditorStyles.toolbarButton, GUILayout.Height(30)))
            {
                NetWorkServer.SendCmd(2);
            }
            if (GUILayout.Button("GCDiff", EditorStyles.toolbarButton, GUILayout.Height(30)))
            {
                NetWorkServer.SendCmd(3);
            }
            if (GUILayout.Button("ClearDiff", EditorStyles.toolbarButton, GUILayout.Height(30)))
            {
                m_luaDiffScrollView.Clear();
            }
            #endregion

            #region gc value
            GUILayout.Space(100);
            GUILayout.FlexibleSpace();
            #endregion

            if (m_TreeView != null)
            {
                m_TreeView.searchString = m_SearchField.OnToolbarGUI(m_TreeView.searchString);
            }


            EditorGUILayout.EndHorizontal();
        }
Esempio n. 7
0
        void DoToolbar()
        {
            EditorGUILayout.BeginHorizontal(EditorStyles.toolbar);

            #region clear
            bool isClear = GUILayout.Button("Clear", EditorStyles.toolbarButton, GUILayout.Height(30));
            if (isClear)
            {
                currentFrameIndex = 0;
                m_TreeView.Clear(true);
                m_luaRefScrollView.ClearRefInfo(true);
                m_luaDiffScrollView.Clear();
                ClearConsole();
            }
            GUILayout.Space(5);
            #endregion

            #region history
            string recordName = "Record";
            bool   flag       = GUILayout.Toggle(LuaDeepProfilerSetting.Instance.isRecord, recordName, EditorStyles.toolbarButton, GUILayout.Height(30));
            if (flag != LuaDeepProfilerSetting.Instance.isRecord)
            {
                LuaDeepProfilerSetting.Instance.isRecord = flag;
            }
            GUILayout.Space(25);
            #endregion

            var setting = LuaDeepProfilerSetting.Instance;

            #region socket
            bool   oldIsLocal = LuaDeepProfilerSetting.Instance.isLocal;
            string localName  = "local mode";
            if (!LuaDeepProfilerSetting.Instance.isLocal)
            {
                localName = "remote mode";
            }
            LuaDeepProfilerSetting.Instance.isLocal = GUILayout.Toggle(LuaDeepProfilerSetting.Instance.isLocal, localName, EditorStyles.toolbarButton, GUILayout.Height(30));
            if (!oldIsLocal && LuaDeepProfilerSetting.Instance.isLocal)
            {
                OpenLocalMode();
            }

            if (!LuaDeepProfilerSetting.Instance.isLocal)
            {
                if (GUILayout.Button("OpenService", EditorStyles.toolbarButton, GUILayout.Height(30)))
                {
                    ClearConsole();
                    NetWorkServer.RealClose();
                    currentFrameIndex = 0;
                    m_TreeView.Clear(true);
                    LuaProfiler.UnRegistReceive();
                    NetWorkServer.UnRegisterReceive();
                    NetWorkServer.RegisterOnReceiveSample(m_TreeView.LoadRootSample);
                    NetWorkServer.RegisterOnReceiveRefInfo(m_luaRefScrollView.DelRefInfo);
                    NetWorkServer.RegisterOnReceiveDiffInfo(m_luaDiffScrollView.DelDiffInfo);
                    NetWorkServer.BeginListen("0.0.0.0", port);
                }
                GUILayout.Label("port:", GUILayout.Height(30), GUILayout.Width(35));
                port = EditorGUILayout.IntField(port, GUILayout.Height(16), GUILayout.Width(50));

                if (GUILayout.Button("CloseService", EditorStyles.toolbarButton, GUILayout.Height(30)))
                {
                    ClearConsole();
                    NetWorkServer.RealClose();
                    UnityEngine.Debug.Log("<color=#ff0000>disconnect</color>");
                }
            }
            else
            {
                GUILayout.Space(10);
                flag = GUILayout.Toggle(setting.isDeepLuaProfiler, "Deep Lua", EditorStyles.toolbarButton);
                if (flag != setting.isDeepLuaProfiler)
                {
                    setting.isDeepLuaProfiler = flag;
                    if (!flag)
                    {
                        setting.isCleanMode = false;
                    }
                    EditorApplication.isPlaying = false;
                }

                flag = GUILayout.Toggle(setting.isDeepMonoProfiler, "Deep Mono", EditorStyles.toolbarButton);
                if (flag != setting.isDeepMonoProfiler)
                {
                    setting.isDeepMonoProfiler  = flag;
                    EditorApplication.isPlaying = false;
                    InjectMethods.Recompile();
                }

                flag = GUILayout.Toggle(setting.discardInvalid, "Discard Invalid", EditorStyles.toolbarButton);
                if (flag != setting.discardInvalid)
                {
                    setting.discardInvalid = flag;
                }

                flag = GUILayout.Toggle(setting.isCleanMode, "PreCompile Lua", EditorStyles.toolbarButton);
                if (flag != setting.isCleanMode)
                {
                    setting.isCleanMode = flag;
                    if (setting.isCleanMode)
                    {
                        setting.isDeepLuaProfiler = true;
                        Selection.activeObject    = LuaProfilerPrecompileSetting.Instance;
#if UNITY_2018_2_OR_NEWER
                        EditorApplication.ExecuteMenuItem("Window/General/Inspector");
#else
                        EditorApplication.ExecuteMenuItem("Window/Inspector");
#endif
                    }
                    EditorApplication.isPlaying = false;
                }
            }

            GUILayout.Space(25);
            if (GUILayout.Button("MarkStaticRecord", EditorStyles.toolbarButton, GUILayout.Height(30)))
            {
                if (!LuaDeepProfilerSetting.Instance.isLocal)
                {
                    NetWorkServer.SendCmd(3);
                }
                else
                {
                    m_luaDiffScrollView.DelDiffInfo(LuaHook.RecordStatic());
                }
                m_luaDiffScrollView.MarkIsStaticRecord();
            }

            if (GUILayout.Button("MarkLuaRecord", EditorStyles.toolbarButton, GUILayout.Height(30)))
            {
                if (!LuaDeepProfilerSetting.Instance.isLocal)
                {
                    NetWorkServer.SendCmd(1);
                }
                else
                {
                    m_luaDiffScrollView.DelDiffInfo(LuaHook.Record());
                }
                m_luaDiffScrollView.MarkIsRecord();
            }
            if (GUILayout.Button("DiffRecord", EditorStyles.toolbarButton, GUILayout.Height(30)))
            {
                if (!LuaDeepProfilerSetting.Instance.isLocal)
                {
                    NetWorkServer.SendCmd(2);
                }
                else
                {
                    m_luaDiffScrollView.DelDiffInfo(LuaHook.Diff());
                }
            }
            if (GUILayout.Button("ClearDiff", EditorStyles.toolbarButton, GUILayout.Height(30)))
            {
                m_luaDiffScrollView.Clear();
            }

            GUILayout.Space(20);
            if (GUILayout.Button("AddLuaDir", EditorStyles.toolbarButton, GUILayout.Height(30)))
            {
                LocalToLuaIDE.AddExternalProjectRootPath();
            }
            if (GUILayout.Button("SetIDE", EditorStyles.toolbarButton, GUILayout.Height(30)))
            {
                LocalToLuaIDE.SetExternalEditorPath();
            }
            if (GUILayout.Button("ClearLuaDir", EditorStyles.toolbarButton, GUILayout.Height(30)))
            {
                LocalToLuaIDE.ClearPath();
            }

            GUILayout.Space(10);
            if (NetWorkServer.acceptThread != null)
            {
                Color c = GUI.color;
                GUI.color = Color.green;
                GUILayout.Label("listerning..");
                GUI.color = c;
            }
            #endregion

            #region gc value
            GUILayout.Space(100);
            GUILayout.FlexibleSpace();
            #endregion

            if (m_TreeView != null)
            {
                m_TreeView.searchString = m_SearchField.OnToolbarGUI(m_TreeView.searchString);
                m_TreeView.toggleMerge  = GUILayout.Toggle(m_TreeView.toggleMerge, "merge", EditorStyles.toolbarButton, GUILayout.Height(30));
            }
            isShowRef = GUILayout.Toggle(isShowRef, "show refInfo", EditorStyles.toolbarButton, GUILayout.Height(30));

            EditorGUILayout.EndHorizontal();
        }
Esempio n. 8
0
        void DoToolbar()
        {
            EditorGUILayout.BeginHorizontal(EditorStyles.toolbar);

            #region clear
            bool isClear = GUILayout.Button("Clear", EditorStyles.toolbarButton, GUILayout.Height(30));
            if (isClear)
            {
                currentFrameIndex = 0;
                m_TreeView.Clear(true);
            }
            GUILayout.Space(5);
            #endregion

            #region history
            bool flag = GUILayout.Toggle(LuaDeepProfilerSetting.Instance.isRecord, "Record", EditorStyles.toolbarButton, GUILayout.Height(30));
            if (flag != LuaDeepProfilerSetting.Instance.isRecord)
            {
                LuaDeepProfilerSetting.Instance.isRecord = flag;
            }
            GUILayout.Space(25);
            #endregion

            #region socket

            if (GUILayout.Button("OpenService", EditorStyles.toolbarButton, GUILayout.Height(30)))
            {
                NetWorkServer.Close();
                currentFrameIndex = 0;
                m_TreeView.Clear(true);
                NetWorkServer.RegisterOnReceive(m_TreeView.LoadRootSample);
                NetWorkServer.BeginListen("0.0.0.0", port);
            }
            GUILayout.Label("port:", GUILayout.Height(30), GUILayout.Width(35));
            port = EditorGUILayout.IntField(port, GUILayout.Height(16), GUILayout.Width(50));

            if (GUILayout.Button("CloseService", EditorStyles.toolbarButton, GUILayout.Height(30)))
            {
                NetWorkServer.Close();
            }
            #endregion

            #region chart
            isShowLuaChart = GUILayout.Toggle(isShowLuaChart, "LuaChart", EditorStyles.toolbarButton, GUILayout.Height(30));
            GUILayout.Space(5);
            isShowMonoChart = GUILayout.Toggle(isShowMonoChart, "MonoChart", EditorStyles.toolbarButton, GUILayout.Height(30));
            GUILayout.Space(25);
            #endregion

            #region path

            /*
             * if (GUILayout.Button("Lua Path", EditorStyles.toolbarButton, GUILayout.Height(30)))
             * {
             *  LocalToLuaIDE.SetExternalProjectRootPath();
             * }
             * if (GUILayout.Button("IDE Path", EditorStyles.toolbarButton, GUILayout.Height(30)))
             * {
             *  LocalToLuaIDE.SetExternalEditorPath();
             * }
             * if (GUILayout.Button("Clear Path", EditorStyles.toolbarButton, GUILayout.Height(30)))
             * {
             *  LocalToLuaIDE.ClearPath();
             * }
             * GUILayout.Space(100);
             * if (GUILayout.Button("Save Result", EditorStyles.toolbarButton, GUILayout.Height(30)))
             * {
             *  m_TreeView.SaveResult();
             * }
             * if (GUILayout.Button("Load Result", EditorStyles.toolbarButton, GUILayout.Height(30)))
             * {
             *  m_TreeView.LoadHistory();
             * }*/
            #endregion

            #region gc value
            GUILayout.Space(100);
            GUILayout.FlexibleSpace();
            GUILayout.Label(string.Format("Lua Total:{0}", m_TreeView.GetLuaMemory()), EditorStyles.toolbarButton, GUILayout.Height(30));

            GUILayout.Space(15);
            GUILayout.Label(string.Format("Mono Total:{0}", m_TreeView.GetMonoMemory()), EditorStyles.toolbarButton, GUILayout.Height(30));
            GUILayout.Space(25);
            #endregion

            m_TreeView.searchString = m_SearchField.OnToolbarGUI(m_TreeView.searchString);

            EditorGUILayout.EndHorizontal();
        }
Esempio n. 9
0
        void DoToolbar()
        {
            EditorGUILayout.BeginHorizontal(EditorStyles.toolbar);

            #region clear
            bool isClear = GUILayout.Button("Clear", EditorStyles.toolbarButton, GUILayout.Height(30));
            if (isClear)
            {
                currentFrameIndex = 0;
                m_TreeView.Clear(true);
                m_luaRefScrollView.ClearRefInfo(true);
                m_luaDiffScrollView.Clear();
                ClearConsole();
            }
            GUILayout.Space(5);
            #endregion

            #region history
            string recordName = "Record";
            bool   flag       = GUILayout.Toggle(LuaDeepProfilerSetting.Instance.isRecord, recordName, EditorStyles.toolbarButton, GUILayout.Height(30));
            if (flag != LuaDeepProfilerSetting.Instance.isRecord)
            {
                LuaDeepProfilerSetting.Instance.isRecord = flag;
            }
            GUILayout.Space(25);
            #endregion

            var setting = LuaDeepProfilerSetting.Instance;

            #region socket
            bool   oldIsLocal = LuaDeepProfilerSetting.Instance.isLocal;
            string localName  = "local mode";
            if (!LuaDeepProfilerSetting.Instance.isLocal)
            {
                localName = "remote mode";
            }
            LuaDeepProfilerSetting.Instance.isLocal = GUILayout.Toggle(LuaDeepProfilerSetting.Instance.isLocal, localName, EditorStyles.toolbarButton, GUILayout.Height(30));
            if (!oldIsLocal && LuaDeepProfilerSetting.Instance.isLocal)
            {
                OpenLocalMode();
            }

            if (!LuaDeepProfilerSetting.Instance.isLocal)
            {
                if (GUILayout.Button("OpenService", EditorStyles.toolbarButton, GUILayout.Height(30)))
                {
                    ClearConsole();
                    NetWorkServer.RealClose();
                    currentFrameIndex = 0;
                    m_TreeView.Clear(true);
                    NetWorkServer.UnRegisterReceive();
                    NetWorkServer.RegisterOnReceiveSample(m_TreeView.LoadRootSample);
                    NetWorkServer.RegisterOnReceiveRefInfo(m_luaRefScrollView.DelRefInfo);
                    NetWorkServer.RegisterOnReceiveDiffInfo(m_luaDiffScrollView.DelDiffInfo);
                    NetWorkServer.BeginListen("0.0.0.0", port);
                }
                GUILayout.Label("port:", GUILayout.Height(30), GUILayout.Width(35));
                port = EditorGUILayout.IntField(port, GUILayout.Height(16), GUILayout.Width(50));

                if (GUILayout.Button("CloseService", EditorStyles.toolbarButton, GUILayout.Height(30)))
                {
                    ClearConsole();
                    NetWorkServer.RealClose();
                    UnityEngine.Debug.Log("<color=#ff0000>disconnect</color>");
                }

                GUILayout.Space(25);
                if (GUILayout.Button("MarkStaticRecord", EditorStyles.toolbarButton, GUILayout.Height(30)))
                {
                    NetWorkServer.SendCmd(3);
                    m_luaDiffScrollView.MarkIsStaticRecord();
                }
                if (GUILayout.Button("MarkLuaRecord", EditorStyles.toolbarButton, GUILayout.Height(30)))
                {
                    NetWorkServer.SendCmd(1);
                    m_luaDiffScrollView.MarkIsRecord();
                }
                if (GUILayout.Button("DiffRecord", EditorStyles.toolbarButton, GUILayout.Height(30)))
                {
                    NetWorkServer.SendCmd(2);
                }
                if (GUILayout.Button("ClearDiff", EditorStyles.toolbarButton, GUILayout.Height(30)))
                {
                    m_luaDiffScrollView.Clear();
                }
            }

            GUILayout.Space(20);
            if (GUILayout.Button("AddLuaDir", EditorStyles.toolbarButton, GUILayout.Height(30)))
            {
                LocalToLuaIDE.AddExternalProjectRootPath();
            }
            if (GUILayout.Button("SetIDE", EditorStyles.toolbarButton, GUILayout.Height(30)))
            {
                LocalToLuaIDE.SetExternalEditorPath();
            }
            if (GUILayout.Button("ClearLuaDir", EditorStyles.toolbarButton, GUILayout.Height(30)))
            {
                LocalToLuaIDE.ClearPath();
            }

            GUILayout.Space(10);
            if (NetWorkServer.acceptThread != null)
            {
                Color c = GUI.color;
                GUI.color = Color.green;
                GUILayout.Label("listerning..");
                GUI.color = c;
            }
            #endregion

            #region gc value
            GUILayout.Space(100);
            GUILayout.FlexibleSpace();
            #endregion

            if (m_TreeView != null)
            {
                m_TreeView.searchString = m_SearchField.OnToolbarGUI(m_TreeView.searchString);
                m_TreeView.toggleMerge  = GUILayout.Toggle(m_TreeView.toggleMerge, "merge", EditorStyles.toolbarButton, GUILayout.Height(30));
            }
            isShowRef = GUILayout.Toggle(isShowRef, "show refInfo", EditorStyles.toolbarButton, GUILayout.Height(30));

            EditorGUILayout.EndHorizontal();
        }