|
Hi, I am using a delegate/ event in my script in a scene called level1. In the scene Level2 i use the same scripts with the delegate / event in there. My question is does the subscriber in the last loaded scene still subscribe to the event and cause it to run the code 2 times? If i run each scene by its self it all works. If i run the scenes after each other the delegates run 2 times. How do i unsubscribe to events before i load the next scene? Thanks
(comments are locked)
|
|
The eventmanager or eventlistener may have been loaded twice. Check if u have used DontDestroyOnLoad function.
(comments are locked)
|
|
If the object is still loaded, it is still subscribed. -= is the syntax for unsubscribing. http://www.youtube.com/watch?v=N2zdwKIsXJs is a very good resource for using Delegates and Events. Yeah i put debugs in that and its connecting and releasing ok seams there is a bug else where
Jan 28 '12 at 11:02 AM
markpollard
(comments are locked)
|
