diff --git a/LuaProfiler/Editor/StartUp.cs b/LuaProfiler/Editor/StartUp.cs index 7798130b..0c8eea0c 100644 --- a/LuaProfiler/Editor/StartUp.cs +++ b/LuaProfiler/Editor/StartUp.cs @@ -111,7 +111,7 @@ public static List FindReferenceAssembly(string name) return result; } - private static bool IsMonoBehavior(TypeDefinition td) + private static bool IsMonoBehaviour(TypeDefinition td) { if (td == null) return false; @@ -127,7 +127,7 @@ private static bool IsMonoBehavior(TypeDefinition td) } else { - return IsMonoBehavior(td.BaseType.Resolve()); + return IsMonoBehaviour(td.BaseType.Resolve()); } } } @@ -192,7 +192,7 @@ private static void InjectAllMethods(string injectPath, string profilerPath) { continue; } - bool isMonoBehaviour = IsMonoBehavior(item.DeclaringType.BaseType.Resolve()); + bool isMonoBehaviour = IsMonoBehaviour(item.DeclaringType.BaseType.Resolve()); if (isMonoBehaviour) { continue; diff --git a/LuaProfiler/Editor/Window/ProfilerWin/TreeView/LuaDiffScrollView.cs b/LuaProfiler/Editor/Window/ProfilerWin/TreeView/LuaDiffScrollView.cs index d16e2108..378a861c 100644 --- a/LuaProfiler/Editor/Window/ProfilerWin/TreeView/LuaDiffScrollView.cs +++ b/LuaProfiler/Editor/Window/ProfilerWin/TreeView/LuaDiffScrollView.cs @@ -152,7 +152,7 @@ public void DoRefScroll() GUILayout.EndScrollView(); GUILayout.BeginHorizontal(); - EditorGUILayout.LabelField("Destory null values count:" + drawCount, GUILayout.Width(200)); + EditorGUILayout.LabelField("Destroy null values count:" + drawCount, GUILayout.Width(200)); if (GUILayout.Button("ShowLog", GUILayout.Width(100))) { ShowLog("null", luaDiff.nullRef, luaDiff.nullDetail); diff --git a/LuaProfiler/Editor/Window/ProfilerWin/TreeView/LuaProfilerTreeView.cs b/LuaProfiler/Editor/Window/ProfilerWin/TreeView/LuaProfilerTreeView.cs index 719cf31a..fc99c0e9 100644 --- a/LuaProfiler/Editor/Window/ProfilerWin/TreeView/LuaProfilerTreeView.cs +++ b/LuaProfiler/Editor/Window/ProfilerWin/TreeView/LuaProfilerTreeView.cs @@ -356,7 +356,7 @@ public Sample CopyToSample() for (int i = 0; i < childCount; i++) { Sample child = childs[i].CopyToSample(); - child.fahter = s; + child.father = s; } s.currentLuaMemory = 0; s.currentMonoMemory = 0; diff --git a/LuaProfiler/Editor/Window/ProfilerWin/TreeView/LuaProfilerWindow.cs b/LuaProfiler/Editor/Window/ProfilerWin/TreeView/LuaProfilerWindow.cs index 935d174d..e8bb5306 100644 --- a/LuaProfiler/Editor/Window/ProfilerWin/TreeView/LuaProfilerWindow.cs +++ b/LuaProfiler/Editor/Window/ProfilerWin/TreeView/LuaProfilerWindow.cs @@ -101,7 +101,7 @@ public class LuaProfilerWindow : EditorWindow private Texture2D monoChart; private Texture2D fpsChart; private Texture2D pssChart; - private Texture2D powrChart; + private Texture2D powerChart; private Texture2D boxTex; private GUIStyle currentStyle; private GUIStyle m_gs; @@ -169,21 +169,21 @@ void OnEnable() } oldStartUrl = null; oldEndUrl = null; - Destory(oldStartT); - Destory(oldEndT); + Destroy(oldStartT); + Destroy(oldEndT); disableChart = null; - Destory(disableChart); + Destroy(disableChart); luaChart = null; - Destory(luaChart); + Destroy(luaChart); monoChart = null; - Destory(monoChart); + Destroy(monoChart); fpsChart = null; - Destory(fpsChart); + Destroy(fpsChart); pssChart = null; - Destory(pssChart); - powrChart = null; - Destory(powrChart); - Destory(boxTex); + Destroy(pssChart); + powerChart = null; + Destroy(powerChart); + Destroy(boxTex); boxTex = null; m_gs = null; currentStyle = null; @@ -196,25 +196,25 @@ void OnEnable() private void OnDisable() { - Destory(disableChart); + Destroy(disableChart); disableChart = null; - Destory(luaChart); + Destroy(luaChart); luaChart = null; - Destory(monoChart); + Destroy(monoChart); monoChart = null; - Destory(fpsChart); + Destroy(fpsChart); fpsChart = null; - Destory(pssChart); + Destroy(pssChart); pssChart = null; - Destory(powrChart); - powrChart = null; - Destory(boxTex); + Destroy(powerChart); + powerChart = null; + Destroy(boxTex); boxTex = null; LuaDeepProfilerSetting.ProfilerWinOpen = false; EditorApplication.update -= m_TreeView.DequeueSample; } - void Destory(UnityEngine.Object o) + void Destroy(UnityEngine.Object o) { if (o == null) return; if (Application.isPlaying) @@ -271,9 +271,9 @@ private void LoadChartTexture() { pssChart = GenTextureColor(15, 15, pssColor); } - if (powrChart == null) + if (powerChart == null) { - powrChart = GenTextureColor(15, 15, powerColor); + powerChart = GenTextureColor(15, 15, powerColor); } } @@ -349,7 +349,7 @@ void DoToolbar() NetWorkMgrClient.Disconnect(); currentFrameIndex = 0; m_TreeView.Clear(true); - LuaProfiler.UnRegistReceive(); + LuaProfiler.UnRegisterReceive(); Sample.UnRegAction(); LuaRefInfo.UnRegAction(); @@ -605,7 +605,7 @@ void DoChartToggle() GUILayout.Space(5); EditorGUILayout.BeginHorizontal(); - t = isShowPowerChart ? powrChart : disableChart; + t = isShowPowerChart ? powerChart : disableChart; isShowPowerChart = GUILayout.Toggle(isShowPowerChart, t, EditorStyles.label, GUILayout.Width(15), GUILayout.Height(15)); GUILayout.Label("Power", GUILayout.Width(40)); GUILayout.Label(m_TreeView.GetPower()); @@ -659,7 +659,7 @@ void DoChart() currentStyle = new GUIStyle(EditorStyles.helpBox); if (boxTex != null) { - Destory(boxTex); + Destroy(boxTex); boxTex = null; } boxTex = GenTextureColor(15, 15, boxColor); @@ -1111,7 +1111,7 @@ private void OpenLocalMode() NetWorkMgrClient.Disconnect(); currentFrameIndex = 0; m_TreeView.Clear(true); - LuaProfiler.UnRegistReceive(); + LuaProfiler.UnRegisterReceive(); Sample.UnRegAction(); LuaRefInfo.UnRegAction(); LuaProfiler.RegisterOnReceiveSample(m_TreeView.LoadRootSample); diff --git a/LuaProfiler/Runtime/Core/Driver/LuaProfiler.cs b/LuaProfiler/Runtime/Core/Driver/LuaProfiler.cs index 7a0155e3..9ce1f418 100644 --- a/LuaProfiler/Runtime/Core/Driver/LuaProfiler.cs +++ b/LuaProfiler/Runtime/Core/Driver/LuaProfiler.cs @@ -76,7 +76,7 @@ public static void RegisterOnReceiveDiffInfo(Action onReceive) m_onReceiveDiff = onReceive; } - public static void UnRegistReceive() + public static void UnRegisterReceive() { m_onReceiveSample = null; m_onReceiveRef = null; @@ -220,7 +220,7 @@ public static void EndSample(IntPtr luaState) sample.costLuaGC = (int)luaGC; sample.costMonoGC = (int)monoGC; - sample.fahter = beginSampleMemoryStack.Count > 0 ? beginSampleMemoryStack.Peek() : null; + sample.father = beginSampleMemoryStack.Count > 0 ? beginSampleMemoryStack.Peek() : null; //UnityEngine.Debug.Log(sample.name); if (beginSampleMemoryStack.Count == 0) { @@ -234,7 +234,7 @@ public static void EndSample(IntPtr luaState) #endif } //释放掉被累加的Sample - if (beginSampleMemoryStack.Count != 0 && sample.fahter == null) + if (beginSampleMemoryStack.Count != 0 && sample.father == null) { sample.Restore(); } diff --git a/LuaProfiler/Runtime/Core/LuaHookSetup.cs b/LuaProfiler/Runtime/Core/LuaHookSetup.cs index 9a3dcbb0..748dcc58 100644 --- a/LuaProfiler/Runtime/Core/LuaHookSetup.cs +++ b/LuaProfiler/Runtime/Core/LuaHookSetup.cs @@ -171,21 +171,21 @@ private void LateUpdate() private void OnApplicationQuit() { #if UNITY_EDITOR - desotryCount = 0; + destroyCount = 0; Destroy(gameObject); - UnityEditor.EditorApplication.update += WaitDestory; + UnityEditor.EditorApplication.update += WaitDestroy; #endif NetWorkMgr.Close(); } #if UNITY_EDITOR - int desotryCount = 0; - private void WaitDestory() + int destroyCount = 0; + private void WaitDestroy() { - desotryCount++; - if (desotryCount > 10) + destroyCount++; + if (destroyCount > 10) { - UnityEditor.EditorApplication.update -= WaitDestory; + UnityEditor.EditorApplication.update -= WaitDestroy; if (LuaProfiler.mainL != IntPtr.Zero) { LuaDLL.lua_close(LuaProfiler.mainL); @@ -193,7 +193,7 @@ private void WaitDestory() LuaDLL.Uninstall(); LuaProfiler.mainL = IntPtr.Zero; NetWorkMgr.Close(); - desotryCount = 0; + destroyCount = 0; } } #endif diff --git a/LuaProfiler/Runtime/Core/NetWork/Packet/LuaRefInfo.cs b/LuaProfiler/Runtime/Core/NetWork/Packet/LuaRefInfo.cs index 080d256f..ade55da9 100644 --- a/LuaProfiler/Runtime/Core/NetWork/Packet/LuaRefInfo.cs +++ b/LuaProfiler/Runtime/Core/NetWork/Packet/LuaRefInfo.cs @@ -62,16 +62,16 @@ public LuaRefInfo Clone() #region static - private static Action OnReciveSample; + private static Action OnReceiveSample; public static void RegAction(Action action) { - OnReciveSample = action; + OnReceiveSample = action; } public static void UnRegAction() { - OnReciveSample = null; + OnReceiveSample = null; } #endregion @@ -95,9 +95,9 @@ public override void Write(MBinaryWriter bw) public override void OnRun() { - if (OnReciveSample != null) + if (OnReceiveSample != null) { - OnReciveSample.Invoke(this); + OnReceiveSample.Invoke(this); } } diff --git a/LuaProfiler/Runtime/Core/NetWork/Packet/Sample.cs b/LuaProfiler/Runtime/Core/NetWork/Packet/Sample.cs index e7b85463..85ef4bde 100644 --- a/LuaProfiler/Runtime/Core/NetWork/Packet/Sample.cs +++ b/LuaProfiler/Runtime/Core/NetWork/Packet/Sample.cs @@ -115,7 +115,7 @@ public string fullName while (f != null) { value = f.name + value; - f = f.fahter; + f = f.father; } _fullName = string.Intern(value); childDict[name] = _fullName; @@ -130,7 +130,7 @@ public string fullName } } - public Sample fahter + public Sample father { set { @@ -175,8 +175,8 @@ public void AddSample(Sample s) for (int i = s.childs.Count - 1; i >= 0; i--) { var item = s.childs[i]; - item.fahter = this; - if (item.fahter != s) + item.father = this; + if (item.father != s) { s.childs.RemoveAt(i); } @@ -247,7 +247,7 @@ public Sample Clone() for (int i = 0; i < childCount; i++) { Sample child = childs[i].Clone(); - child.fahter = s; + child.father = s; } s.currentLuaMemory = currentLuaMemory; @@ -260,16 +260,16 @@ public Sample Clone() #region static - private static Action OnReciveSample; + private static Action OnReceiveSample; public static void RegAction(Action action) { - OnReciveSample = action; + OnReceiveSample = action; } public static void UnRegAction() { - OnReciveSample = null; + OnReceiveSample = null; } #endregion @@ -831,9 +831,9 @@ public override void Write(MBinaryWriter bw) public override void OnRun() { - if (OnReciveSample != null) + if (OnReceiveSample != null) { - OnReciveSample.Invoke(this); + OnReceiveSample.Invoke(this); } } diff --git a/LuaProfiler~/Tools/InjectAPKTool/InjectToLua/DLL/Core/Driver/LuaProfiler.cs b/LuaProfiler~/Tools/InjectAPKTool/InjectToLua/DLL/Core/Driver/LuaProfiler.cs index cfd70010..56b95d12 100644 --- a/LuaProfiler~/Tools/InjectAPKTool/InjectToLua/DLL/Core/Driver/LuaProfiler.cs +++ b/LuaProfiler~/Tools/InjectAPKTool/InjectToLua/DLL/Core/Driver/LuaProfiler.cs @@ -129,7 +129,7 @@ public static void PopAllSampleWhenLateUpdate(IntPtr luaState) while(beginSampleMemoryStack.Count > 0) { var item = beginSampleMemoryStack.Pop(); - if (item.fahter == null) + if (item.father == null) { if (beginSampleMemoryStack.Count > 0) { @@ -157,7 +157,7 @@ public static void PopAllSampleWhenLateUpdate(IntPtr luaState) item.currentLuaMemory = (int)LuaLib.GetLuaMemory(luaState); for (int i = 0, imax = popChilds.Count; i < imax; i++) { - popChilds[i].fahter = item; + popChilds[i].father = item; } popChilds.Clear(); NetWorkClient.SendMessage(item); @@ -213,7 +213,7 @@ public static void EndSample(IntPtr luaState) sample.Restore(); return; } - sample.fahter = beginSampleMemoryStack.Count > 0 ? beginSampleMemoryStack.Peek() : null; + sample.father = beginSampleMemoryStack.Count > 0 ? beginSampleMemoryStack.Peek() : null; //UnityEngine.Debug.Log(sample.name); if (beginSampleMemoryStack.Count == 0) { @@ -240,7 +240,7 @@ public static void EndSample(IntPtr luaState) NetWorkClient.SendMessage(sample); } //释放掉被累加的Sample - if (beginSampleMemoryStack.Count != 0 && sample.fahter == null) + if (beginSampleMemoryStack.Count != 0 && sample.father == null) { sample.Restore(); } diff --git a/LuaProfiler~/Tools/InjectAPKTool/InjectToLua/DLL/Core/Driver/Sample.cs b/LuaProfiler~/Tools/InjectAPKTool/InjectToLua/DLL/Core/Driver/Sample.cs index 73c9a1b8..482736d7 100644 --- a/LuaProfiler~/Tools/InjectAPKTool/InjectToLua/DLL/Core/Driver/Sample.cs +++ b/LuaProfiler~/Tools/InjectAPKTool/InjectToLua/DLL/Core/Driver/Sample.cs @@ -177,7 +177,7 @@ public bool CheckSampleValid() } #region property - public Sample fahter + public Sample father { set { @@ -263,8 +263,8 @@ public void AddSample(Sample s) for (int i = s.childs.Count - 1; i >= 0; i--) { var item = s.childs[i]; - item.fahter = this; - if (item.fahter != s) + item.father = this; + if (item.father != s) { s.childs.RemoveAt(i); } @@ -303,7 +303,7 @@ public Sample Clone() for (int i = 0; i < childCount; i++) { Sample child = childs[i].Clone(); - child.fahter = s; + child.father = s; } s.currentLuaMemory = currentLuaMemory; diff --git a/LuaProfiler~/Tools/InjectAPKTool/InjectToLua/DLL/Core/LuaHookSetup.cs b/LuaProfiler~/Tools/InjectAPKTool/InjectToLua/DLL/Core/LuaHookSetup.cs index 365dfe6b..7ccaffa8 100644 --- a/LuaProfiler~/Tools/InjectAPKTool/InjectToLua/DLL/Core/LuaHookSetup.cs +++ b/LuaProfiler~/Tools/InjectAPKTool/InjectToLua/DLL/Core/LuaHookSetup.cs @@ -142,29 +142,29 @@ private void LateUpdate() private void OnApplicationQuit() { #if UNITY_EDITOR - desotryCount = 0; + destroyCount = 0; Destroy(gameObject); - UnityEditor.EditorApplication.update += WaitDestory; + UnityEditor.EditorApplication.update += WaitDestroy; #else NetWorkClient.Close(); #endif } #if UNITY_EDITOR - int desotryCount = 0; - private void WaitDestory() + int destroyCount = 0; + private void WaitDestroy() { - desotryCount++; - if (desotryCount > 10) + destroyCount++; + if (destroyCount > 10) { - UnityEditor.EditorApplication.update -= WaitDestory; + UnityEditor.EditorApplication.update -= WaitDestroy; if (LuaProfiler.mainL != IntPtr.Zero) { LuaDLL.lua_close(LuaProfiler.mainL); } LuaProfiler.mainL = IntPtr.Zero; NetWorkClient.Close(); - desotryCount = 0; + destroyCount = 0; } } #endif diff --git a/LuaProfiler~/Tools/InjectAPKTool/InjectToLua/InjectMethods.cs b/LuaProfiler~/Tools/InjectAPKTool/InjectToLua/InjectMethods.cs index b63039f7..0b02ed01 100644 --- a/LuaProfiler~/Tools/InjectAPKTool/InjectToLua/InjectMethods.cs +++ b/LuaProfiler~/Tools/InjectAPKTool/InjectToLua/InjectMethods.cs @@ -123,7 +123,7 @@ public static void InjectAllMethods(string injectPath, string profilerPath) { continue; } - bool isMonoBehaviour = IsMonoBehavior(item.DeclaringType.BaseType.Resolve()); + bool isMonoBehaviour = IsMonoBehaviour(item.DeclaringType.BaseType.Resolve()); if (isMonoBehaviour) { continue; @@ -240,7 +240,7 @@ public static void HookLuaFun(string luaPath, string profilerPath) } #region try finally - private static bool IsMonoBehavior(TypeDefinition td) + private static bool IsMonoBehaviour(TypeDefinition td) { if (td == null) return false; @@ -256,7 +256,7 @@ private static bool IsMonoBehavior(TypeDefinition td) } else { - return IsMonoBehavior(td.BaseType.Resolve()); + return IsMonoBehaviour(td.BaseType.Resolve()); } } } diff --git a/LuaProfiler~/Tools/LuaProfilerWinform/LuaProfilerWinform/HookLib/Core/Common/Sample.cs b/LuaProfiler~/Tools/LuaProfilerWinform/LuaProfilerWinform/HookLib/Core/Common/Sample.cs index 8253e3ce..34c4a68d 100644 --- a/LuaProfiler~/Tools/LuaProfilerWinform/LuaProfilerWinform/HookLib/Core/Common/Sample.cs +++ b/LuaProfiler~/Tools/LuaProfilerWinform/LuaProfilerWinform/HookLib/Core/Common/Sample.cs @@ -286,7 +286,7 @@ public string fullName while (f != null) { value = f.name + value; - f = f.fahter; + f = f.father; } _fullName = value; childDict[name] = string.Intern(_fullName); @@ -301,7 +301,7 @@ public string fullName } } - public Sample fahter + public Sample father { set { @@ -395,8 +395,8 @@ public void AddSample(Sample s) for (int i = s.childs.Count - 1; i >= 0; i--) { var item = s.childs[i]; - item.fahter = this; - if (item.fahter != s) + item.father = this; + if (item.father != s) { s.childs.RemoveAt(i); } @@ -418,7 +418,7 @@ public Sample Clone() for (int i = 0; i < childCount; i++) { Sample child = childs[i].Clone(); - child.fahter = s; + child.father = s; } s.currentLuaMemory = currentLuaMemory; @@ -541,7 +541,7 @@ public static Sample Deserialize(BinaryReader b) len = b.ReadInt32(); datas = b.ReadBytes(len); Sample child = Deserialize(datas); - child.fahter = s; + child.father = s; } bool hasCapture = b.ReadBoolean(); diff --git a/LuaProfiler~/Tools/LuaProfilerWinform/LuaProfilerWinform/HookLib/Core/LuaProfiler.cs b/LuaProfiler~/Tools/LuaProfilerWinform/LuaProfilerWinform/HookLib/Core/LuaProfiler.cs index e7f7cfac..c33e5ec9 100644 --- a/LuaProfiler~/Tools/LuaProfilerWinform/LuaProfilerWinform/HookLib/Core/LuaProfiler.cs +++ b/LuaProfiler~/Tools/LuaProfilerWinform/LuaProfilerWinform/HookLib/Core/LuaProfiler.cs @@ -64,7 +64,7 @@ public static void RegisterOnReceiveDiffInfo(Action onReceive) m_onReceiveDiff = onReceive; } - public static void UnRegistReceive() + public static void UnRegisterReceive() { m_onReceiveSample = null; m_onReceiveRef = null; @@ -144,7 +144,7 @@ public static void PopAllSampleWhenLateUpdate(IntPtr luaState) while(beginSampleMemoryStack.Count > 0) { var item = beginSampleMemoryStack.Pop(); - if (item.fahter == null) + if (item.father == null) { if (beginSampleMemoryStack.Count > 0) { @@ -172,7 +172,7 @@ public static void PopAllSampleWhenLateUpdate(IntPtr luaState) item.currentLuaMemory = (int)LuaDLL.GetLuaMemory(luaState); for (int i = 0, imax = popChilds.Count; i < imax; i++) { - popChilds[i].fahter = item; + popChilds[i].father = item; } popChilds.Clear(); // TODO @@ -225,7 +225,7 @@ public static void EndSample(IntPtr luaState) sample.Restore(); return; } - sample.fahter = beginSampleMemoryStack.Count > 0 ? beginSampleMemoryStack.Peek() : null; + sample.father = beginSampleMemoryStack.Count > 0 ? beginSampleMemoryStack.Peek() : null; //UnityEngine.Debug.Log(sample.name); if (beginSampleMemoryStack.Count == 0) { @@ -233,7 +233,7 @@ public static void EndSample(IntPtr luaState) NetWorkClient.SendMessage(sample); } //释放掉被累加的Sample - if (beginSampleMemoryStack.Count != 0 && sample.fahter == null) + if (beginSampleMemoryStack.Count != 0 && sample.father == null) { sample.Restore(); } diff --git a/LuaProfiler~/Tools/LuaProfilerWinform/LuaProfilerWinform/Winform/NetWork/NetWorkServer.cs b/LuaProfiler~/Tools/LuaProfilerWinform/LuaProfilerWinform/Winform/NetWork/NetWorkServer.cs index e036591a..b9084432 100644 --- a/LuaProfiler~/Tools/LuaProfilerWinform/LuaProfilerWinform/Winform/NetWork/NetWorkServer.cs +++ b/LuaProfiler~/Tools/LuaProfilerWinform/LuaProfilerWinform/Winform/NetWork/NetWorkServer.cs @@ -307,7 +307,7 @@ public static Sample Deserialize(BinaryReader br) int count = br.ReadUInt16(); for (int i = 0, imax = count; i < imax; i++) { - Deserialize(br).fahter = s; + Deserialize(br).father = s; } int lua_gc = 0;