UniRx (Reactive Extensions for Unity) is a reimplementation of the .NET Reactive Extensions. The Official Rx implementation is great but doesn't work on Unity and has issues with iOS IL2CPP compatibility. This library fixes those issues and adds some specific utilities for Unity. Supported platforms are PC/Mac/Android/iOS/WebGL/WindowsStore/etc and the library. Ordinarily, Network operations in Unity require the use of WWW and Coroutine. Rx cures that kind of "asynchronous blues". Rx is a library for composing asynchronous and event-based programs using observable collections and LINQ-style query operators. The game loop (every Update, OnCollisionEnter, etc), sensor data (Kinect, Leap Motion, VR Input, etc.) are all types of events. Rx represents events as reactive sequences which are both easily composable and support time-based operations by using LINQ query operators.
Features
- UniRx is available on the Unity Asset Store (free)
- Unity is generally single threaded but UniRx facilitates multithreading for joins, cancels, accessing GameObjects, etc.
- UniRx helps UI programming with uGUI. All UI events (clicked, valuechanged, etc) can be converted to UniRx event streams
- Unity supports async/await from 2017 with C# upgrades
- Use ObservableWWW for asynchronous network operations
- Rx is composable and cancelable, you can also query with LINQ expressions