Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
GGJ2016
Totem
Commits
45c376cd
Commit
45c376cd
authored
Feb 01, 2016
by
Thierry
Browse files
Fix bugs where event handlers did not properly unregister themselves...
parent
a30cd347
Changes
2
Show whitespace changes
Inline
Side-by-side
Assets/Scripts/UI/Game/HealthBarHUD.cs
View file @
45c376cd
...
...
@@ -19,6 +19,10 @@ public class HealthBarHUD : MonoBehaviour {
PlayerHealthUpdateEvent
.
handler
+=
OnPlayerHealthUpdate
;
}
void
OnDestroy
()
{
PlayerHealthUpdateEvent
.
handler
-=
OnPlayerHealthUpdate
;
}
private
void
OnPlayerHealthUpdate
(
PlayerHealthUpdateEvent
e
)
{
if
(!
e
.
Victim
.
Identity
.
hasAuthority
)
return
;
...
...
Assets/Scripts/UI/Lobby/LobbyUIManager.cs
View file @
45c376cd
...
...
@@ -66,6 +66,8 @@ public class LobbyUIManager : MonoBehaviour {
}
void
OnDestroy
()
{
LobbyMngr
.
onConnected
-=
OnConnected
;
LobbyMngr
.
onDisconnected
-=
OnDisconnected
;
PlayerConnectedEvent
.
handler
-=
OnPlayerConnectedEvent
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment