We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5999478 commit 92cd9ccCopy full SHA for 92cd9cc
testproject/Assets/Tests/Manual/Scripts/StatsDisplay.cs
@@ -18,7 +18,6 @@ public class StatsDisplay : NetworkBehaviour
18
private Text m_ClientServerToggleText;
19
private List<ulong> m_ClientsToUpdate = new List<ulong>();
20
21
-
22
private bool m_IsServer;
23
24
private void Start()
@@ -72,6 +71,14 @@ private void OnClientConnectedCallback(ulong clientId)
72
71
}
73
74
+ /// <summary>
75
+ /// Remove our OnClientConnectedCallback registration when we are destroyed
76
+ /// </summary>
77
+ private void OnDestroy()
78
+ {
79
+ NetworkManager.OnClientConnectedCallback -= OnClientConnectedCallback;
80
+ }
81
+
82
/// <summary>
83
/// Used by UI Button click event
84
/// </summary>
0 commit comments