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.

DispatcherOnChange.cs 492B

123456789101112131415161718192021222324
  1. using System.Collections.Generic;
  2. namespace Svelto.ECS
  3. {
  4. public class DispatchOnChange<T> : DispatchOnSet<T>
  5. {
  6. public DispatchOnChange(int senderID) : base(senderID)
  7. { }
  8. public new T value
  9. {
  10. set
  11. {
  12. if (EqualityComparer<T>.Default.Equals(value, _value) == false)
  13. base.value = value;
  14. }
  15. get
  16. {
  17. return _value;
  18. }
  19. }
  20. }
  21. }