diff --git a/playground-unity/ProjectSettings/ProjectVersion.txt b/playground-unity/ProjectSettings/ProjectVersion.txt
index 8386a05..1a62a67 100644
--- a/playground-unity/ProjectSettings/ProjectVersion.txt
+++ b/playground-unity/ProjectSettings/ProjectVersion.txt
@@ -1,2 +1,2 @@
-m_EditorVersion: 2021.3.45f1
-m_EditorVersionWithRevision: 2021.3.45f1 (0da89fac8e79)
+m_EditorVersion: 2021.3.45f2
+m_EditorVersionWithRevision: 2021.3.45f2 (88f88f591b2e)
diff --git a/projects/TinkState-Unity-Test/TinkState-Unity-Test.csproj b/projects/TinkState-Unity-Test/TinkState-Unity-Test.csproj
index 2623032..1e5778c 100644
--- a/projects/TinkState-Unity-Test/TinkState-Unity-Test.csproj
+++ b/projects/TinkState-Unity-Test/TinkState-Unity-Test.csproj
@@ -24,8 +24,8 @@
-
- ../../unity-dlls/UnityEngine.dll
+
+ ../../unity-dlls/UnityEngine.CoreModule.dll
../../unity-dlls/UnityEngine.TestRunner.dll
diff --git a/projects/TinkState-Unity/TinkState-Unity.csproj b/projects/TinkState-Unity/TinkState-Unity.csproj
index a89fd65..89962e9 100644
--- a/projects/TinkState-Unity/TinkState-Unity.csproj
+++ b/projects/TinkState-Unity/TinkState-Unity.csproj
@@ -15,8 +15,8 @@
-
- ../../unity-dlls/UnityEngine.dll
+
+ ../../unity-dlls/UnityEngine.CoreModule.dll
diff --git a/src/TinkState-Unity/Runtime/UnityBatchScheduler.cs b/src/TinkState-Unity/Runtime/UnityBatchScheduler.cs
index 00ca079..7c6ad15 100644
--- a/src/TinkState-Unity/Runtime/UnityBatchScheduler.cs
+++ b/src/TinkState-Unity/Runtime/UnityBatchScheduler.cs
@@ -50,7 +50,17 @@ void Progress(float maxSeconds)
// we have two queues and swap between them to avoid allocating a new list every time
var currentQueue = queue;
queue = nextQueue;
- foreach (var o in currentQueue) o.Run();
+ foreach (var o in currentQueue)
+ {
+ try
+ {
+ o.Run();
+ }
+ catch (Exception e)
+ {
+ Debug.LogException(e);
+ }
+ }
currentQueue.Clear();
nextQueue = currentQueue;
}
@@ -62,7 +72,7 @@ void Progress(float maxSeconds)
}
}
- float GetTimeStamp()
+ static float GetTimeStamp()
{
return Time.realtimeSinceStartup;
}
@@ -95,7 +105,7 @@ static PlayerLoopSystem[] AppendLoopSystem(PlayerLoopSystem[] subSystemList, Pla
static int FindLoopSystemIndex(PlayerLoopSystem[] subSystemList, Type systemType)
{
- for (int i = 0; i < subSystemList.Length; i++)
+ for (var i = 0; i < subSystemList.Length; i++)
{
if (subSystemList[i].type == systemType)
{
diff --git a/src/TinkState-Unity/Tests/TestUnityBatchScheduler.cs b/src/TinkState-Unity/Tests/TestUnityBatchScheduler.cs
index 7557e05..b7d9d10 100644
--- a/src/TinkState-Unity/Tests/TestUnityBatchScheduler.cs
+++ b/src/TinkState-Unity/Tests/TestUnityBatchScheduler.cs
@@ -1,4 +1,6 @@
+using System;
using System.Collections;
+using System.Collections.Generic;
using NUnit.Framework;
using UnityEngine.TestTools;
using TinkState;
@@ -104,4 +106,30 @@ void BindCallback(int value)
yield return null;
Assert.That(bindingCalls, Is.EqualTo(3));
}
-}
\ No newline at end of file
+
+ [UnityTest]
+ public IEnumerator TestBindingExceptionNotStoppingProcessing()
+ {
+ var state = Observable.State(10);
+ var calls = new List();
+ var binding1Called = false;
+ state.Bind(value =>
+ {
+ if (!binding1Called)
+ {
+ binding1Called = true;
+ calls.Add("a");
+ }
+ else throw new Exception("FAIL");
+ });
+ state.Bind(value =>
+ {
+ calls.Add("b");
+ });
+ Assert.That(calls, Is.EquivalentTo(new [] {"a", "b"}));
+ state.Value = 15;
+ yield return null;
+ LogAssert.Expect(LogType.Exception, "Exception: FAIL");
+ Assert.That(calls, Is.EquivalentTo(new [] {"a", "b", "b"}));
+ }
+}
diff --git a/unity-dlls/UnityEngine.CoreModule.dll b/unity-dlls/UnityEngine.CoreModule.dll
new file mode 100644
index 0000000..d383898
Binary files /dev/null and b/unity-dlls/UnityEngine.CoreModule.dll differ
diff --git a/unity-dlls/UnityEngine.dll b/unity-dlls/UnityEngine.dll
deleted file mode 100644
index 3515b7c..0000000
Binary files a/unity-dlls/UnityEngine.dll and /dev/null differ