Arch.EventBus
Arch.EventBus, a high-performance way of sending notifications or events.
Example
public partial class MyInstanceReceiver {
public MysInstanceReceiver(){ Hook(); } // To start listening.
[Event]
public void OnShootEvent(ref ShootEvent @event){
// Handle
}
}
public static class SomeEventHandler{
[Event(order: 2)]
public static void OnShootFireBullets(ref ShootEvent @event){ // ref, none, in supported and all types as a event. Only one param!
// Do stuff
}
[Event(order: 1)]
public static void OnShootFireBullets(ref ShootEvent @event){ // ref, none, in supported and all types as a event. Only one param!
// Do stuff
}
}
var shootEvent = new ShootEvent();
EventBus.Send(ref shootEvent); // Broadcasts the event to all annotated methods wherever they are.Last updated