From c16e1fb67b001dc4fef95f3d7ec4c87c98bf4eec Mon Sep 17 00:00:00 2001 From: ale Date: Thu, 1 Dec 2022 17:34:17 +0800 Subject: [PATCH] =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=94=B9=E6=88=90json?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Setting/LuaDeepProfilerAssetSetting.cs | 2 +- .../Common/Setting/LuaDeepProfilerSetting.cs | 232 ++++++++---------- .../Setting/LuaProfilerPrecompileSetting.cs | 2 +- .../LuaProfiler/Common/Setting/Resources.meta | 8 + .../Resources/LuaDeepProfilerSetting.txt | 1 + .../Resources/LuaDeepProfilerSetting.txt.meta | 7 + .../Assets/LuaProfiler/Core/Driver/LuaDLL.cs | 2 +- .../LuaProfiler/Core/Driver/LuaProfiler.cs | 20 -- .../Assets/LuaProfiler/Core/LuaHookSetup.cs | 18 +- ...rkHelper.cs.meta => NetWorkClient.cs.meta} | 3 +- .../Assets/LuaProfiler/Editor/StartUp.cs | 20 +- .../TreeView/LuaProfilerTreeView.cs | 10 +- .../ProfilerWin/TreeView/LuaProfilerWindow.cs | 18 -- 13 files changed, 132 insertions(+), 211 deletions(-) create mode 100644 LuaProfiler/example/Assets/LuaProfiler/Common/Setting/Resources.meta create mode 100644 LuaProfiler/example/Assets/LuaProfiler/Common/Setting/Resources/LuaDeepProfilerSetting.txt create mode 100644 LuaProfiler/example/Assets/LuaProfiler/Common/Setting/Resources/LuaDeepProfilerSetting.txt.meta rename LuaProfiler/example/Assets/LuaProfiler/Core/NetWork/{NetWorkHelper.cs.meta => NetWorkClient.cs.meta} (84%) diff --git a/LuaProfiler/example/Assets/LuaProfiler/Common/Setting/LuaDeepProfilerAssetSetting.cs b/LuaProfiler/example/Assets/LuaProfiler/Common/Setting/LuaDeepProfilerAssetSetting.cs index e9443689..a3f67be8 100644 --- a/LuaProfiler/example/Assets/LuaProfiler/Common/Setting/LuaDeepProfilerAssetSetting.cs +++ b/LuaProfiler/example/Assets/LuaProfiler/Common/Setting/LuaDeepProfilerAssetSetting.cs @@ -33,7 +33,7 @@ * ============================================================================== */ -#if UNITY_EDITOR_WIN || USE_LUA_PROFILER +#if UNITY_EDITOR_WIN using UnityEngine; using UnityEditor; diff --git a/LuaProfiler/example/Assets/LuaProfiler/Common/Setting/LuaDeepProfilerSetting.cs b/LuaProfiler/example/Assets/LuaProfiler/Common/Setting/LuaDeepProfilerSetting.cs index 028eb822..bd862611 100644 --- a/LuaProfiler/example/Assets/LuaProfiler/Common/Setting/LuaDeepProfilerSetting.cs +++ b/LuaProfiler/example/Assets/LuaProfiler/Common/Setting/LuaDeepProfilerSetting.cs @@ -33,16 +33,17 @@ * ============================================================================== */ +using System; +using System.IO; + #if UNITY_EDITOR_WIN || USE_LUA_PROFILER namespace MikuLuaProfiler { using System.Collections.Generic; - #if UNITY_EDITOR_WIN - using UnityEditor; - #endif using UnityEngine; - public class LuaDeepProfilerSetting : ScriptableObject + [Serializable] + public class LuaDeepProfilerSetting { #region instance private static LuaDeepProfilerSetting instance; @@ -52,56 +53,51 @@ public static LuaDeepProfilerSetting Instance { if (instance == null) { - instance = AssetDatabase.LoadAssetAtPath("Assets/LuaDeepProfilerSetting.asset"); - if (instance == null) - { - UnityEngine.Debug.Log("Lua Profiler: cannot find integration settings, creating default settings"); - instance = CreateInstance(); - instance.name = "Lua Profiler LuaDeepProfiler Setting"; -#if UNITY_EDITOR - AssetDatabase.CreateAsset(instance, "Assets/LuaDeepProfilerSetting.asset"); -#endif - } + instance = new LuaDeepProfilerSetting(); } return instance; } } #endregion - public bool isDeepMonoProfiler - { - get - { - return LuaDeepProfilerAssetSetting.Instance.isDeepMonoProfiler; - } - set - { - LuaDeepProfilerAssetSetting.Instance.isDeepMonoProfiler = value; - } - } - public bool isDeepLuaProfiler { get { + #if UNITY_EDITOR return LuaDeepProfilerAssetSetting.Instance.isDeepLuaProfiler; + #else + return m_isDeepLuaProfiler; + #endif } set { + m_isDeepLuaProfiler = value; + Save(); +#if UNITY_EDITOR LuaDeepProfilerAssetSetting.Instance.isDeepLuaProfiler = value; +#endif } } + public bool isLocal { get { +#if UNITY_EDITOR return LuaDeepProfilerAssetSetting.Instance.isLocal; +#else + return false; +#endif } set { +#if UNITY_EDITOR LuaDeepProfilerAssetSetting.Instance.isLocal = value; +#endif } } + public bool isCleanMode { get @@ -113,83 +109,11 @@ public bool isCleanMode if (this.m_isCleanMode != value) { this.m_isCleanMode = value; - EditorUtility.SetDirty(this); - } - } - } - - public int captureLuaGC - { - get - { - return this.m_captureLuaGC; - } - set - { - if (this.m_captureLuaGC != value) - { - this.m_captureLuaGC = value; - EditorUtility.SetDirty(this); - } - } - } - - public bool isNeedCapture - { - get - { - return this.m_isNeedCapture; - } - set - { - if (this.m_isNeedCapture != value) - { - this.m_isNeedCapture = value; - EditorUtility.SetDirty(this); - } - } - } - - public string GetAssMD5ByPath(string path) - { - var index = m_assMd5Key.IndexOf(path); - if (index < 0) - { - return ""; - } - return m_assMd5[index]; - } - - public void SetAssMD5ByPath(string path, string value) - { - var index = m_assMd5Key.IndexOf(path); - if (index < 0) - { - m_assMd5Key.Add(path); - m_assMd5.Add(value); - } - else - { - m_assMd5[index] = value; - } - EditorUtility.SetDirty(this); - } - - public bool isInited - { - get - { - return this.m_isInited; - } - set - { - if (this.m_isInited != value) - { - this.m_isInited = value; - EditorUtility.SetDirty(this); + Save(); } } } + public bool discardInvalid { @@ -202,23 +126,7 @@ public bool discardInvalid if (m_discardInvalid != value) { m_discardInvalid = value; - EditorUtility.SetDirty(this); - } - } - } - - public int captureMonoGC - { - get - { - return this.m_captureMonoGC; - } - set - { - if (this.m_captureMonoGC != value) - { - this.m_captureMonoGC = value; - EditorUtility.SetDirty(this); + Save(); } } } @@ -234,7 +142,7 @@ public int captureFrameRate if (this.m_captureFrameRate != value) { this.m_captureFrameRate = value; - EditorUtility.SetDirty(this); + Save(); } } } @@ -250,7 +158,7 @@ public string ip if (!(this.m_ip == value)) { this.m_ip = value; - EditorUtility.SetDirty(this); + Save(); } } } @@ -266,7 +174,7 @@ public int port if (this.m_port != value) { this.m_port = value; - EditorUtility.SetDirty(this); + Save(); } } } @@ -281,7 +189,7 @@ public bool isRecord { if (m_isRecord == value) return; m_isRecord = value; - EditorUtility.SetDirty(this); + Save(); } } @@ -295,7 +203,7 @@ public bool isStartRecord { if (m_isNeedRecord == value) return; m_isNeedRecord = value; - EditorUtility.SetDirty(this); + Save(); } } @@ -309,7 +217,7 @@ public bool isFrameRecord { if (m_isFrameRecord == value) return; m_isFrameRecord = value; - EditorUtility.SetDirty(this); + Save(); } } @@ -326,8 +234,7 @@ public void AddLuaDir(string path) if (!m_luaDir.Contains(path)) { m_luaDir.Add(path); - EditorUtility.SetDirty(this); - AssetDatabase.SaveAssets(); + Save(); } } @@ -341,22 +248,16 @@ public string luaIDE { if (m_luaIDE == value) return; m_luaIDE = value; - EditorUtility.SetDirty(this); - AssetDatabase.SaveAssets(); + Save(); } } public const string SettingsAssetName = "LuaDeepProfilerSettings"; - public bool m_isDeepMonoProfiler = false; + public bool m_isNeedRecord = false; public bool m_isDeepLuaProfiler = false; public bool m_isCleanMode = false; - public int m_captureLuaGC = 51200; - public bool m_isNeedCapture = false; public bool m_discardInvalid = true; - public List m_assMd5Key = new List(); - public List m_assMd5 = new List(); - public bool m_isInited = false; - public int m_captureMonoGC = 51200; + public bool m_isFrameRecord = false; public int m_captureFrameRate = 30; public string m_ip = "127.0.0.1"; public int m_port = 2333; @@ -366,8 +267,67 @@ public string luaIDE private List m_luaDir = new List(); [SerializeField] private string m_luaIDE = ""; - private bool m_isNeedRecord = false; - private bool m_isFrameRecord = true; + +#if UNITY_EDITOR + public void Save() + { + string path = null; + var files = System.IO.Directory.GetFiles(Application.dataPath, "LuaDeepProfilerSetting.cs", System.IO.SearchOption.AllDirectories); + if (files.Length > 0) + { + var f = files[0]; + f = f.Replace("\\", "/"); + var dirPath = f.Replace("LuaDeepProfilerSetting.cs", "Resources"); + if (!Directory.Exists(dirPath)) + { + Directory.CreateDirectory(dirPath); + } + + path = f.Replace("LuaDeepProfilerSetting.cs", "Resources/LuaDeepProfilerSetting.txt"); + } + else + { + throw new Exception("你改了我的文件名,自己想办法拯救吧"); + } + + string v = JsonUtility.ToJson(this); + File.WriteAllText(path, v); + } +#else + public void Save() + {} +#endif + public static LuaDeepProfilerSetting Load() + { + LuaDeepProfilerSetting result = null; + var ta = Resources.Load("LuaDeepProfilerSetting"); + if (ta == null) + { + result = new LuaDeepProfilerSetting(); +#if UNITY_EDITOR + result.Save(); +#endif + } + else + { + string json = ta.text; + Resources.UnloadAsset(ta); + + try + { + JsonUtility.FromJson(json); + } + catch + { + result = new LuaDeepProfilerSetting(); +#if UNITY_EDITOR + result.Save(); +#endif + } + } + return result; + } + } } #endif \ No newline at end of file diff --git a/LuaProfiler/example/Assets/LuaProfiler/Common/Setting/LuaProfilerPrecompileSetting.cs b/LuaProfiler/example/Assets/LuaProfiler/Common/Setting/LuaProfilerPrecompileSetting.cs index b0e58411..ffa64562 100644 --- a/LuaProfiler/example/Assets/LuaProfiler/Common/Setting/LuaProfilerPrecompileSetting.cs +++ b/LuaProfiler/example/Assets/LuaProfiler/Common/Setting/LuaProfilerPrecompileSetting.cs @@ -33,7 +33,7 @@ * ============================================================================== */ -#if UNITY_EDITOR_WIN || USE_LUA_PROFILER +#if UNITY_EDITOR_WIN namespace MikuLuaProfiler { using System; diff --git a/LuaProfiler/example/Assets/LuaProfiler/Common/Setting/Resources.meta b/LuaProfiler/example/Assets/LuaProfiler/Common/Setting/Resources.meta new file mode 100644 index 00000000..15cc7885 --- /dev/null +++ b/LuaProfiler/example/Assets/LuaProfiler/Common/Setting/Resources.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 3f766e1ff12e7d54b9ab95bf7f001278 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LuaProfiler/example/Assets/LuaProfiler/Common/Setting/Resources/LuaDeepProfilerSetting.txt b/LuaProfiler/example/Assets/LuaProfiler/Common/Setting/Resources/LuaDeepProfilerSetting.txt new file mode 100644 index 00000000..28be46f4 --- /dev/null +++ b/LuaProfiler/example/Assets/LuaProfiler/Common/Setting/Resources/LuaDeepProfilerSetting.txt @@ -0,0 +1 @@ +{"m_isNeedRecord":false,"m_isDeepLuaProfiler":true,"m_isCleanMode":false,"m_discardInvalid":true,"m_isFrameRecord":false,"m_captureFrameRate":30,"m_ip":"127.0.0.1","m_port":2333,"m_luaDir":[],"m_luaIDE":""} \ No newline at end of file diff --git a/LuaProfiler/example/Assets/LuaProfiler/Common/Setting/Resources/LuaDeepProfilerSetting.txt.meta b/LuaProfiler/example/Assets/LuaProfiler/Common/Setting/Resources/LuaDeepProfilerSetting.txt.meta new file mode 100644 index 00000000..ba321622 --- /dev/null +++ b/LuaProfiler/example/Assets/LuaProfiler/Common/Setting/Resources/LuaDeepProfilerSetting.txt.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 3313c01a196f4764f97734f241fedf62 +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/LuaProfiler/example/Assets/LuaProfiler/Core/Driver/LuaDLL.cs b/LuaProfiler/example/Assets/LuaProfiler/Core/Driver/LuaDLL.cs index 2103d259..b95c362d 100644 --- a/LuaProfiler/example/Assets/LuaProfiler/Core/Driver/LuaDLL.cs +++ b/LuaProfiler/example/Assets/LuaProfiler/Core/Driver/LuaDLL.cs @@ -122,7 +122,7 @@ public static void lua_unref(IntPtr luaState, int reference) #if UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN private static NativeUtilInterface nativeUtil = new WindowsNativeUtil(); #elif UNITY_ANDROID - private static NativeUtilInterface nativeUtil = new AndroidNativeHooker(); + private static NativeUtilInterface nativeUtil = new AndroidNativeUtil(); #endif #endregion diff --git a/LuaProfiler/example/Assets/LuaProfiler/Core/Driver/LuaProfiler.cs b/LuaProfiler/example/Assets/LuaProfiler/Core/Driver/LuaProfiler.cs index 925f5359..dc5d4257 100644 --- a/LuaProfiler/example/Assets/LuaProfiler/Core/Driver/LuaProfiler.cs +++ b/LuaProfiler/example/Assets/LuaProfiler/Core/Driver/LuaProfiler.cs @@ -225,26 +225,6 @@ public static void EndSample(IntPtr luaState) { var setting = LuaDeepProfilerSetting.Instance; if (setting == null) return; - if (setting != null && setting.isNeedCapture) - { - //迟钝了 - if (sample.costTime >= (1 / (float)(setting.captureFrameRate)) * 10000000) - { - sample.captureUrl = Sample.Capture(); - } - else if (sample.costLuaGC > setting.captureLuaGC) - { - sample.captureUrl = Sample.Capture(); - } - else if (sample.costMonoGC > setting.captureMonoGC) - { - sample.captureUrl = Sample.Capture(); - } - else - { - sample.captureUrl = null; - } - } if (!setting.isLocal) { NetWorkClient.SendMessage(sample); diff --git a/LuaProfiler/example/Assets/LuaProfiler/Core/LuaHookSetup.cs b/LuaProfiler/example/Assets/LuaProfiler/Core/LuaHookSetup.cs index 7142a2ce..2a86d7ac 100644 --- a/LuaProfiler/example/Assets/LuaProfiler/Core/LuaHookSetup.cs +++ b/LuaProfiler/example/Assets/LuaProfiler/Core/LuaHookSetup.cs @@ -54,7 +54,6 @@ public class HookLuaSetup : MonoBehaviour private float deltaTime = 0f; public const float DELTA_TIME = 0.1f; - public float currentTime = 0; private static bool isInite = false; private static Queue actionQueue = new Queue(); public static void RegisterAction(Action a) @@ -66,11 +65,6 @@ public static void RegisterAction(Action a) } #endregion -#if UNITY_EDITOR_WIN - [System.Runtime.InteropServices.DllImport("kernel32.dll")] - private extern static IntPtr LoadLibrary(string path); -#endif - #if UNITY_5 || UNITY_2017_1_OR_NEWER [RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)] @@ -85,10 +79,6 @@ public static void OnStartGame() isInite = true; setting = LuaDeepProfilerSetting.Instance; LuaProfiler.mainThreadId = System.Threading.Thread.CurrentThread.ManagedThreadId; - if (setting.isNeedCapture) - { - Screen.SetResolution(480, 270, true); - } #if UNITY_EDITOR if (setting.isDeepLuaProfiler) @@ -105,7 +95,7 @@ public static void OnStartGame() } #endif - if (setting.isDeepLuaProfiler || setting.isDeepMonoProfiler || setting.isCleanMode) + if (setting.isDeepLuaProfiler || setting.isCleanMode) { GameObject go = new GameObject(); go.name = "MikuLuaProfiler"; @@ -145,12 +135,6 @@ private void LateUpdate() count = 0; deltaTime = 0f; } - if (Time.unscaledTime - currentTime > DELTA_TIME) - { - SampleData.pss = NativeHelper.GetPass(); - SampleData.power = NativeHelper.GetBatteryLevel(); - currentTime = Time.unscaledTime; - } LuaProfiler.SendFrameSample(); if (Input.touchCount == 4 || Input.GetKeyDown(KeyCode.Delete)) { diff --git a/LuaProfiler/example/Assets/LuaProfiler/Core/NetWork/NetWorkHelper.cs.meta b/LuaProfiler/example/Assets/LuaProfiler/Core/NetWork/NetWorkClient.cs.meta similarity index 84% rename from LuaProfiler/example/Assets/LuaProfiler/Core/NetWork/NetWorkHelper.cs.meta rename to LuaProfiler/example/Assets/LuaProfiler/Core/NetWork/NetWorkClient.cs.meta index e019611c..e0618535 100644 --- a/LuaProfiler/example/Assets/LuaProfiler/Core/NetWork/NetWorkHelper.cs.meta +++ b/LuaProfiler/example/Assets/LuaProfiler/Core/NetWork/NetWorkClient.cs.meta @@ -1,8 +1,7 @@ fileFormatVersion: 2 guid: 317e8d7f7830bf841b45bdf4d57f90b3 -timeCreated: 1551069481 -licenseType: Pro MonoImporter: + externalObjects: {} serializedVersion: 2 defaultReferences: [] executionOrder: 0 diff --git a/LuaProfiler/example/Assets/LuaProfiler/Editor/StartUp.cs b/LuaProfiler/example/Assets/LuaProfiler/Editor/StartUp.cs index b01d8f9b..8bad0cac 100644 --- a/LuaProfiler/example/Assets/LuaProfiler/Editor/StartUp.cs +++ b/LuaProfiler/example/Assets/LuaProfiler/Editor/StartUp.cs @@ -51,10 +51,10 @@ public static class StartUp { static StartUp() { - if (LuaDeepProfilerSetting.Instance.isDeepMonoProfiler) - { - InjectMethods.InjectAllMethods(); - } + // if (LuaDeepProfilerSetting.Instance.isDeepMonoProfiler) + // { + // InjectMethods.InjectAllMethods(); + // } } } @@ -136,7 +136,7 @@ private static void InjectAllMethods(string injectPath, string profilerPath) { string md5 = null; md5 = new FileInfo(injectPath).LastWriteTimeUtc.Ticks.ToString(); - if (md5 == LuaDeepProfilerSetting.Instance.GetAssMD5ByPath(injectPath)) return; + //if (md5 == LuaDeepProfilerSetting.Instance.GetAssMD5ByPath(injectPath)) return; AssemblyDefinition injectAss = LoadAssembly(injectPath); AssemblyDefinition profilerAss = null; @@ -224,7 +224,7 @@ private static void InjectAllMethods(string injectPath, string profilerPath) } WriteAssembly(injectPath, injectAss); - LuaDeepProfilerSetting.Instance.SetAssMD5ByPath(injectPath, new FileInfo(injectPath).LastWriteTimeUtc.Ticks.ToString()); + //LuaDeepProfilerSetting.Instance.SetAssMD5ByPath(injectPath, new FileInfo(injectPath).LastWriteTimeUtc.Ticks.ToString()); } private static string GetReflectionName(this TypeReference type) @@ -501,10 +501,10 @@ private static void AddResolver(AssemblyDefinition assembly) [UnityEditor.Callbacks.PostProcessScene] private static void OnPostprocessScene() { - if (LuaDeepProfilerSetting.Instance.isDeepMonoProfiler) - { - //InjectAllMethods(projectPath, profilerPath); - } + // if (LuaDeepProfilerSetting.Instance.isDeepMonoProfiler) + // { + // InjectAllMethods(projectPath, profilerPath); + // } } #endif } diff --git a/LuaProfiler/example/Assets/LuaProfiler/Editor/Window/ProfilerWin/TreeView/LuaProfilerTreeView.cs b/LuaProfiler/example/Assets/LuaProfiler/Editor/Window/ProfilerWin/TreeView/LuaProfilerTreeView.cs index 13322c64..390d963f 100644 --- a/LuaProfiler/example/Assets/LuaProfiler/Editor/Window/ProfilerWin/TreeView/LuaProfilerTreeView.cs +++ b/LuaProfiler/example/Assets/LuaProfiler/Editor/Window/ProfilerWin/TreeView/LuaProfilerTreeView.cs @@ -955,7 +955,7 @@ public int GetPreFrame(int start, bool isChange) public int GetNextProgramFrame(int start) { if (history.Count <= 0) return 0; - start = Math.Max(1, Math.Min(start, history.Count - 1)); + start = Math.Max(0, Math.Min(start, history.Count - 1)); int ret = start + 1; if (ret >= history.Count) return history.Count - 1; @@ -964,11 +964,11 @@ public int GetNextProgramFrame(int start) { ret = i; var s = history[i]; - if (s.costLuaGC > setting.captureLuaGC) + if (s.costLuaGC > 0) { break; } - else if (s.costMonoGC > setting.captureMonoGC) + else if (s.costMonoGC > 0) { break; } @@ -990,11 +990,11 @@ public int GetPreProgramFrame(int start) { ret = i; var s = history[i]; - if (s.costLuaGC > setting.captureLuaGC) + if (s.costLuaGC > 0) { break; } - else if (s.costMonoGC > setting.captureMonoGC) + else if (s.costMonoGC > 0) { break; } diff --git a/LuaProfiler/example/Assets/LuaProfiler/Editor/Window/ProfilerWin/TreeView/LuaProfilerWindow.cs b/LuaProfiler/example/Assets/LuaProfiler/Editor/Window/ProfilerWin/TreeView/LuaProfilerWindow.cs index 0a73051e..42259135 100644 --- a/LuaProfiler/example/Assets/LuaProfiler/Editor/Window/ProfilerWin/TreeView/LuaProfilerWindow.cs +++ b/LuaProfiler/example/Assets/LuaProfiler/Editor/Window/ProfilerWin/TreeView/LuaProfilerWindow.cs @@ -405,14 +405,6 @@ void DoToolbar() 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) { @@ -605,16 +597,6 @@ void DoRecord() } 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));