com.wallstop-studios.unity-helpers 2.0.0-rc54 → 2.0.0-rc55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -63,24 +63,23 @@
|
|
|
63
63
|
TaskCompletionSource<T[]> taskCompletionSource = new();
|
|
64
64
|
|
|
65
65
|
SceneLoadScope sceneScope = new(scenePath, OnSceneLoaded);
|
|
66
|
-
|
|
67
|
-
{
|
|
68
|
-
return new DeferredDisposalResult<T[]>(
|
|
69
|
-
result.Result,
|
|
70
|
-
async () =>
|
|
71
|
-
{
|
|
72
|
-
TaskCompletionSource<bool> disposalComplete = new();
|
|
73
|
-
UnityMainThreadDispatcher.Instance.RunOnMainThread(
|
|
74
|
-
() =>
|
|
75
|
-
sceneScope
|
|
76
|
-
.DisposeAsync()
|
|
77
|
-
.ContinueWith(_ => disposalComplete.SetResult(true))
|
|
78
|
-
);
|
|
66
|
+
T[] result = await taskCompletionSource.Task;
|
|
79
67
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
)
|
|
83
|
-
|
|
68
|
+
return new DeferredDisposalResult<T[]>(
|
|
69
|
+
result,
|
|
70
|
+
() =>
|
|
71
|
+
{
|
|
72
|
+
TaskCompletionSource<bool> disposalComplete = new();
|
|
73
|
+
UnityMainThreadDispatcher.Instance.RunOnMainThread(
|
|
74
|
+
() =>
|
|
75
|
+
sceneScope
|
|
76
|
+
.DisposeAsync()
|
|
77
|
+
.ContinueWith(_ => disposalComplete.SetResult(true))
|
|
78
|
+
);
|
|
79
|
+
|
|
80
|
+
return disposalComplete.Task;
|
|
81
|
+
}
|
|
82
|
+
);
|
|
84
83
|
|
|
85
84
|
void OnSceneLoaded(Scene scene, LoadSceneMode mode)
|
|
86
85
|
{
|
|
@@ -102,7 +101,7 @@
|
|
|
102
101
|
return go.scene == scene;
|
|
103
102
|
})
|
|
104
103
|
.ToArray();
|
|
105
|
-
taskCompletionSource.
|
|
104
|
+
taskCompletionSource.SetResult(foundObjects);
|
|
106
105
|
}
|
|
107
106
|
}
|
|
108
107
|
|