explaingit

neuecc/unirx

7,323C#Audience · developerComplexity · 3/5Setup · easy

TLDR

UniRx is a Unity library that replaces messy coroutine code with clean, stream-based event handling, letting game developers filter, combine, and react to inputs, network calls, and frame updates in a readable query style.

Mindmap

mindmap
  root((repo))
    What It Does
      Event streams
      Async handling
      Replaces coroutines
    Stream Operations
      Filter events
      Combine streams
      Delay and debounce
    Platforms
      PC and Mac
      Android and iOS
      WebGL support
    Status
      Superseded by R3
      UniTask companion
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Replace tangled Unity coroutines with readable reactive streams that can return values and catch errors

USE CASE 2

Handle button clicks, frame updates, and sensor input as composable event streams in a Unity game

USE CASE 3

Detect complex input patterns like double-clicks by composing timing checks over click event streams

USE CASE 4

Manage parallel network requests with cancellation and progress tracking in a mobile Unity project

Tech stack

C#Unity.NET

Getting it running

Difficulty · easy Time to first run · 30min

Author now recommends the successor library Cysharp/R3 for new projects, UniRx is in maintenance mode.

In plain English

UniRx is a library for Unity game developers that makes it easier to write code that responds to events and handles asynchronous operations. Unity's built-in approach to asynchronous work uses a mechanism called coroutines, but coroutines have real limitations: they cannot return values and cannot handle exceptions, which tends to produce tangled, hard-to-maintain code. UniRx provides a different approach based on Reactive Extensions (Rx), a programming pattern originally from the .NET world. The core idea is to treat events as streams that you can filter, combine, delay, and transform using a query style that looks similar to database queries. In practice, this means things like button clicks, game loop updates (every frame), sensor input from devices like Kinect or VR controllers, and network responses can all be treated as observable event streams. You write rules about how those streams should behave, and the library handles the details. For example, detecting a double-click means watching a stream of click events and checking whether two arrive within 250 milliseconds. The library also makes network requests cancellable, supports running multiple requests in parallel, and includes progress tracking. UniRx supports PC, Mac, Android, iOS, WebGL, and Windows Store. It was written to work around Unity-specific platform issues, particularly compatibility problems with iOS's IL2CPP compilation mode that the official .NET Rx library did not handle. The library is free and was available through the Unity Asset Store. The README opens with an important note: the author now distributes an evolved successor called Cysharp/R3 and recommends using that instead of UniRx. Async/await integration was also separated into a companion project called UniTask after version 7.0. The full README is longer than what was shown.

Copy-paste prompts

Prompt 1
Using UniRx in Unity, show me how to detect a double-click on a UI button where two clicks arrive within 250 milliseconds
Prompt 2
I have multiple HTTP requests in a Unity game. Show me how to run them in parallel with UniRx and combine their results once all finish
Prompt 3
Using UniRx, how do I debounce a Unity search input field so the search only fires after the user stops typing for half a second?
Prompt 4
Convert this Unity coroutine that downloads a file and updates a progress bar into a UniRx observable stream
Prompt 5
Show me how to combine keyboard input and mouse position into a single observable stream in Unity using UniRx
Open on GitHub → Explain another repo

← neuecc on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.