Setup

Install UniFlux

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

Generate your Scritps

using UniFlux;
using UnityEngine;

public class Test : MonoFlux
{
    private void Start()
    {
        // Allows you to call any method subscribe with "0" Key
        "0".Dispatch();
    }
    [MethodFlux("0")] private void Tester()
    {
        Debug.Log("Hello world");
    }
}

You can put both in a scene and see if they both receive the event

That's all !

Here another sample making subscriptions manually

Last updated