You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Added helpers for loading assets from an `AssetBundle`.
15
+
- Added `AsyncUtility.FrameTime` await helper.
16
+
17
+
### Changed
18
+
- Added `DebuggerHidden` attribute to some properties/methods to make stack traces a bit more friendly.
19
+
- Renamed `AsyncContinuationContext` to `AsyncCallbackOptions`.
20
+
- Renamed web request helper methods (added `Async` postfix to their names).
21
+
- Moved Unity extension methods to `UnityFx.Async.Extensions` namespace (previously they were in namespace `UnityFx.Async`).
22
+
23
+
### Fixed
24
+
- Fixed web requests `null` result in cases when downloaded file failed to open.
25
+
- Fixed `AsyncUtility.AddCompletionCallback` exception when adding new callbacks from another callback.
26
+
- Fixed `AsyncUpdateSource` implementation to allow adding listeners from a callback.
27
+
- Fixed `AsyncCompletionSource.SetProgress` implementation to allow setting progress when the operation is not started.
28
+
29
+
### Removed
30
+
- Removed many specialized `IAsyncOperationCallbacks` methods to make the interface as minimalistic as possible (new extension methods are added to compensate).
31
+
- Removed `(Try)SetExceptions` methods/extensions and `FromExceptions` helpers.
32
+
- Removed extension methods of the `Animation` class.
33
+
- Removed `WaitAsync` extension methods of the `Animator` class.
Copy file name to clipboardExpand all lines: LICENSE.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# MIT License
2
2
3
-
Copyright (c) 2017-2018 Alexander Bogarsukov.
3
+
Copyright (c) 2017-2019 Alexander Bogarsukov.
4
4
5
5
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
Unity Asset Store | [](https://assetstore.unity.com/packages/tools/asynchronous-operations-for-unity-96696)
8
+
Unity Asset Store | [](https://assetstore.unity.com/packages/tools/asynchronous-operations-for-unity-96696)
9
9
10
10
**Requires Unity 5.4 or higher.**
11
11
@@ -43,6 +43,8 @@ The table below summarizes differences berween *UnityFx.Async* and other popular
43
43
| Minimum operation data size for 32-bit systems (in bytes) | 32+ | 36+ | 40+ |
44
44
| Minimum number of allocations per continuation |~1 | 5+ | 2+ |
45
45
46
+
**NOTE**: As the table states [ExecutionContext](https://docs.microsoft.com/en-us/dotnet/api/system.threading.executioncontext) flow is NOT supported. Please use [Tasks](https://docs.microsoft.com/en-us/dotnet/api/system.threading.tasks.task) if you need it.
47
+
46
48
## Getting Started
47
49
### Prerequisites
48
50
You may need the following software installed in order to build/use the library:
@@ -170,8 +172,9 @@ In fact the only notable difference from synchronous implementation is usage of
170
172
## Using the library
171
173
Reference the DLL and import the namespace:
172
174
```csharp
173
-
usingUnityFx.Async;
174
-
usingUnityFx.Async.Promises; // For promises-specific stuff.
Please note that all `SetXxx` methods throw `InvalidOperationException` if the operation is completed. Use corresponding `TrySetXxx` methods is this behaviour is not desired.
229
+
225
230
### Waiting for an operation to complete
226
231
The simpliest way to get notified of an operation completion is registering a completion handler to be invoked when the operation succeeds (the JS promise-like way):
227
232
```csharp
@@ -501,6 +506,56 @@ AsyncUtility.PostToMainThread(() => Debug.Log("On the main thread."));
501
506
// If calling thread is the main thread executes the delegate synchronously, otherwise posts it to the main thread. Returns an asynchronous operation that can be used to track the delegate execution.
502
507
AsyncUtility.InvokeOnMainThread(() =>Debug.Log("On the main thread."));
503
508
```
509
+
Converting a coroutine to promise is very easy:
510
+
```csharp
511
+
// The coroutine body. The completion source can be used to return promise results or report an error.
The comparison table below shows how *UnityFx.Async* entities relate to [Tasks](https://docs.microsoft.com/en-us/dotnet/api/system.threading.tasks.task):
0 commit comments