Mirror of Svelto.ECS because we're a fan of it
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
326B

  1. public class Dispatcher<S, T>
  2. {
  3. public event System.Action<S, T> observers;
  4. private Dispatcher() { }
  5. public Dispatcher(S sender)
  6. {
  7. _sender = sender;
  8. }
  9. virtual public void Dispatch(T value)
  10. {
  11. if (observers != null)
  12. observers(_sender, value);
  13. }
  14. S _sender;
  15. }