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.

23 lines
404B

  1. using System.Collections.Generic;
  2. public class DispatcherOnChange<S, T>: Dispatcher<S, T>
  3. {
  4. public DispatcherOnChange(S sender) : base(sender) { }
  5. public T value
  6. {
  7. set
  8. {
  9. if (EqualityComparer<T>.Default.Equals(value, _value) == false)
  10. {
  11. _value = value;
  12. Dispatch(value);
  13. }
  14. }
  15. }
  16. T _value;
  17. }