Ejemplo n.º 1
0
            public static IntPtr luaL_newstate()
            {
                IntPtr l = ProxyNewstate();

                if (LuaDeepProfilerSetting.Instance.isDeepProfiler)
                {
                    MikuLuaProfilerLuaProfilerWrap.__Register(l);
                    Install();
                    LuaProfiler.mainL = l;
                    if (LuaDeepProfilerSetting.Instance.isRecord)
                    {
                        GameViewUtility.ChangeGameViewSize(480, 270);
                    }
                }
                return(l);
            }
Ejemplo n.º 2
0
        void DoToolbar()
        {
            EditorGUILayout.BeginHorizontal(EditorStyles.toolbar);

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

            #region deep
            bool flag = GUILayout.Toggle(LuaDeepProfilerSetting.Instance.isDeepProfiler,
                                         "Deep Profiler Lua", EditorStyles.toolbarButton, GUILayout.Height(30));
            if (flag != LuaDeepProfilerSetting.Instance.isDeepProfiler)
            {
                LuaDeepProfilerSetting.Instance.isDeepProfiler = flag;
                EditorApplication.isPlaying = false;
                InjectMethods.Recompile();
            }
            GUILayout.Space(5);

            flag = GUILayout.Toggle(LuaDeepProfilerSetting.Instance.profilerMono,
                                    "Include Mono", EditorStyles.toolbarButton, GUILayout.Height(30));
            if (flag != LuaDeepProfilerSetting.Instance.profilerMono)
            {
                LuaDeepProfilerSetting.Instance.profilerMono = flag;
                EditorApplication.isPlaying = false;
                InjectMethods.Recompile();
            }
            GUILayout.Space(5);

            flag = GUILayout.Toggle(LuaDeepProfilerSetting.Instance.includeCSLua,
                                    "Contain C# Lua", EditorStyles.toolbarButton, GUILayout.Height(30));
            if (flag != LuaDeepProfilerSetting.Instance.includeCSLua)
            {
                LuaDeepProfilerSetting.Instance.includeCSLua = flag;
                EditorApplication.isPlaying = false;
                InjectMethods.Recompile();
            }
            GUILayout.Space(5);
            #endregion

            #region stop
            bool isStop = GUILayout.Toggle(m_isStop, "Stop GC", EditorStyles.toolbarButton, GUILayout.Height(30));

            if (m_isStop != isStop)
            {
                if (isStop)
                {
                    LuaLib.StopGC();
                    m_isStop = true;
                }
                else
                {
                    LuaLib.ResumeGC();
                    m_isStop = false;
                }
            }
            GUILayout.Space(5);
            #endregion

            #region run gc
            bool isRunGC = GUILayout.Button("Run GC", EditorStyles.toolbarButton, GUILayout.Height(30));
            if (isRunGC)
            {
                LuaLib.RunGC();
            }
            GUILayout.Space(5);
            #endregion

            #region history
            flag = GUILayout.Toggle(LuaDeepProfilerSetting.Instance.isRecord,
                                    "Record", EditorStyles.toolbarButton, GUILayout.Height(30));
            if (flag != LuaDeepProfilerSetting.Instance.isRecord)
            {
                LuaDeepProfilerSetting.Instance.isRecord = flag;
                if (flag)
                {
                    GameViewUtility.ChangeGameViewSize(480, 270);
                }
                EditorApplication.isPlaying = false;
            }
            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(5);
            GUILayout.FlexibleSpace();
            GUILayout.Label(string.Format("Lua Total:{0}", m_TreeView.GetLuaMemory()), EditorStyles.toolbarButton, GUILayout.Height(30));
            #endregion

            GUILayout.Space(100);
            GUILayout.FlexibleSpace();

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

            EditorGUILayout.EndHorizontal();
        }