Skip to content
6 changes: 3 additions & 3 deletions LuaProfiler/Editor/StartUp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public static List<string> FindReferenceAssembly(string name)
return result;
}

private static bool IsMonoBehavior(TypeDefinition td)
private static bool IsMonoBehaviour(TypeDefinition td)
{
if (td == null) return false;

Expand All @@ -127,7 +127,7 @@ private static bool IsMonoBehavior(TypeDefinition td)
}
else
{
return IsMonoBehavior(td.BaseType.Resolve());
return IsMonoBehaviour(td.BaseType.Resolve());
}
}
}
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
52 changes: 26 additions & 26 deletions LuaProfiler/Editor/Window/ProfilerWin/TreeView/LuaProfilerWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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)
Expand Down Expand Up @@ -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);
}
}

Expand Down Expand Up @@ -349,7 +349,7 @@ void DoToolbar()
NetWorkMgrClient.Disconnect();
currentFrameIndex = 0;
m_TreeView.Clear(true);
LuaProfiler.UnRegistReceive();
LuaProfiler.UnRegisterReceive();
Sample.UnRegAction();
LuaRefInfo.UnRegAction();

Expand Down Expand Up @@ -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());
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions LuaProfiler/Runtime/Core/Driver/LuaProfiler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public static void RegisterOnReceiveDiffInfo(Action<LuaDiffInfo> onReceive)
m_onReceiveDiff = onReceive;
}

public static void UnRegistReceive()
public static void UnRegisterReceive()
{
m_onReceiveSample = null;
m_onReceiveRef = null;
Expand Down Expand Up @@ -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)
{
Expand All @@ -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();
}
Expand Down
16 changes: 8 additions & 8 deletions LuaProfiler/Runtime/Core/LuaHookSetup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -171,29 +171,29 @@ 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);
}
LuaDLL.Uninstall();
LuaProfiler.mainL = IntPtr.Zero;
NetWorkMgr.Close();
desotryCount = 0;
destroyCount = 0;
}
}
#endif
Expand Down
10 changes: 5 additions & 5 deletions LuaProfiler/Runtime/Core/NetWork/Packet/LuaRefInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,16 +62,16 @@ public LuaRefInfo Clone()

#region static

private static Action<LuaRefInfo> OnReciveSample;
private static Action<LuaRefInfo> OnReceiveSample;

public static void RegAction(Action<LuaRefInfo> action)
{
OnReciveSample = action;
OnReceiveSample = action;
}

public static void UnRegAction()
{
OnReciveSample = null;
OnReceiveSample = null;
}
#endregion

Expand All @@ -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);
}
}

Expand Down
20 changes: 10 additions & 10 deletions LuaProfiler/Runtime/Core/NetWork/Packet/Sample.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -130,7 +130,7 @@ public string fullName
}
}

public Sample fahter
public Sample father
{
set
{
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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;
Expand All @@ -260,16 +260,16 @@ public Sample Clone()

#region static

private static Action<Sample> OnReciveSample;
private static Action<Sample> OnReceiveSample;

public static void RegAction(Action<Sample> action)
{
OnReciveSample = action;
OnReceiveSample = action;
}

public static void UnRegAction()
{
OnReciveSample = null;
OnReceiveSample = null;
}
#endregion

Expand Down Expand Up @@ -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);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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)
{
Expand All @@ -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();
}
Expand Down
Loading