UniFlux
UniFlux provides a flexible, event-driven Flux architecture for Unity projects. It enables efficient state management and event dispatching with minimal garbage allocation, supporting both traditional and attribute-based method binding patterns. Optimized for performance, it integrates seamlessly into existing workflows through multiple installation options and comprehensive documentation.
com.xavierarpa.uniflux Install via UPM
Add to Unity Package Manager using this URL
https://www.pkglnk.dev/uniflux.git README Markdown
Copy this to your project's README.md
## Installation
Add **UniFlux** to your Unity project via Package Manager:
1. Open **Window > Package Manager**
2. Click **+** > **Add package from git URL**
3. Enter:
```
https://www.pkglnk.dev/uniflux.git
```
[](https://www.pkglnk.dev/pkg/uniflux)README
UniFlux - Flexible Event Driven and Flux for Unity
ā ļø Please read Documentation
š Try UniFlux Toolkit
Installation
You can Download at Unity Asset Store
You can use the .unityPackage in releases
You can use the *.tzg in releases and add in PackageManager
You can add in PackageManager (How to install package from git URL)
https://github.com/xavierarpa/UniFlux.git
- You can install via openupm CLI
openupm add com.xavierarpa.uniflux
- You can install via npm
npm i com.xavierarpa.uniflux
Performance
| Name | Iterations | GC | Time |
|---|---|---|---|
| UniFlux (Dispatch |
10.000 | 0B | 1ms |
| UniFlux (ADD Store |
10.000 | 1.2MB | ~3ms |
| UniFlux (REMOVE Store |
10.000 | 1.2MB | ~3ms |
Note: Storing (ADD and REMOVE) by design is planned to do it once so there's no problem in performance.
Tip: MethodFlux in Interfaces
You can use [MethodFlux] directly in an interface so that implementations are automatically detected. Example:
public interface IService<T>
{
T Service
{
[MethodFlux(0)] get; // attribute lives on the interface
}
}
internal class AudioModule : MonoFlux, IAudioService
{
IAudioService IService<IAudioService>.Service => this;
// ā Automatically subscribed ā UniFlux reads the attribute from the interface
}
Personal recommendation from Xavier!
Star History
License
MIT License Copyright (c) 2023 Xavier Thomas Peter Arpa Lopez 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: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
No comments yet. Be the first!