Created
December 13, 2013 18:36
-
-
Save splhack/7948983 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/csharp/unity/wrapper/LWFObject.cs b/csharp/unity/wrapper/LWFObject.cs | |
index c257411..b02054c 100644 | |
--- a/csharp/unity/wrapper/LWFObject.cs | |
+++ b/csharp/unity/wrapper/LWFObject.cs | |
@@ -104,7 +104,8 @@ public class LWFObject : MonoBehaviour | |
{ | |
isAlive = false; | |
- lwfDestroyCallbacks.ForEach(c => c(this)); | |
+ foreach (var c in lwfDestroyCallbacks) | |
+ c(this); | |
lwfDestroyCallbacks = null; | |
if (lwfName == null) | |
@@ -210,7 +211,8 @@ public class LWFObject : MonoBehaviour | |
public virtual void OnLoad() | |
{ | |
- lwfLoadCallbacks.ForEach(c => c(this)); | |
+ foreach (var c in lwfLoadCallbacks) | |
+ c(this); | |
lwfLoadCallbacks = null; | |
} | |
@@ -637,7 +639,8 @@ public class LWFObject : MonoBehaviour | |
string instanceName, MovieEventHandler handler, bool immortal = false) | |
{ | |
AddLoadCallback((o) => { | |
- MovieEventHandler h = (m) => { | |
+ MovieEventHandler h = nil; | |
+ h = (m) => { | |
if (!immortal) | |
lwf.RemoveMovieEventHandler(instanceName, load:h); | |
handler(m); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment