Skip to content

Commit

Permalink
OpenUPM details
Browse files Browse the repository at this point in the history
  • Loading branch information
skibitsky authored Jun 8, 2020
1 parent a650488 commit 002ca11
Showing 1 changed file with 30 additions and 10 deletions.
40 changes: 30 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,40 @@
# EventBus
# EventBus [![openupm](https://img.shields.io/npm/v/com.futuclass.event-bus?label=openupm&registry_uri=https://package.openupm.com)](https://openupm.com/packages/com.futuclass.event-bus/)


EventBus is a system, which can dispatch published events to any registered handler accepting particular event argument. This means, that your event sources should no longer contain references to other components, only to event bus.

This creates a clean separation between event sources and handlers, and allows to build handler pipelines dynamically in runtime, rather than compile time. So in theory you can even load third-party libraries adopted for this Event Bus and insert their handlers into the pipeline. For example, this behavior can be used to implement plugin systems.

## Installation
#### Using UnityPackageManager (for Unity 2018.3 or later)
Find the manifest.json file in the Packages folder of your project and edit it to look like this:
```js
{
"dependencies": {
"com.futuclass.event-bus": "https://github.com/futuclass/EventBus.git",
...
},
}

### Install via OpenUPM

The package is available on the [openupm registry](https://openupm.com). It's recommended to install it via [openupm-cli](https://github.com/openupm/openupm-cli).

```
openupm add com.futuclass.event-bus
```

### Install via Git URL

Open *Packages/manifest.json* with your favorite text editor. Add the following line to the dependencies block.

{
"dependencies": {
"com.futuclass.event-bus": "https://github.com/Futuclass/EventBus.git"
}
}

Notice: Unity Package Manager records the current commit to a lock entry of the *manifest.json*. To update to the latest version, change the hash value manually or remove the lock entry to resolve the package.

"lock": {
"com.futuclass.event-bus": {
"revision": "master",
"hash": "..."
}
}


## Features
- Custom event arguments.
- Automatic event data mapping to handlers by type.
Expand Down

0 comments on commit 002ca11

Please sign in to comment.