Skip to content

Commit bc96813

Browse files
committed
取消debug的后台事件监听
1 parent 1a2c717 commit bc96813

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

Assets/GameFramework/Setting/DebugHelper.cs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,17 @@ public class DebugHelper : MonoBehaviour
4141
private Vector2 _scrollDrawCallView = Vector2.zero;
4242
//System
4343
private Vector2 _scrollSystemView = Vector2.zero;
44+
4445
#endregion
45-
46-
private void Awake()
46+
47+
private void OnEnable()
4748
{
4849
Application.logMessageReceived += LogCallback;
4950
}
51+
private void OnDisable()
52+
{
53+
Application.logMessageReceived -= LogCallback;
54+
}
5055
private void Update()
5156
{
5257
FPSUpdate();
@@ -62,11 +67,7 @@ private void OnGUI()
6267
_windowRect = GUI.Window(0, _windowRect, ShrinkGUIWindow, "DEBUG");
6368
}
6469
}
65-
private void OnDestory()
66-
{
67-
Application.logMessageReceived -= LogCallback;
68-
}
69-
70+
7071
/// <summary>
7172
/// 刷新FPS
7273
/// </summary>

0 commit comments

Comments
 (0)