Using a Change Filter from a Component System?

I’m trying to write a really simple system which synchronizes my Entities with a MonoBehaviour. The MonoBehaviour needs to know when its associated entity is changed so that it can play an animation.

It seems like the obvious way to do this would be:

  public class AnimateCardsSystem : ComponentSystem
  {
    protected override void OnUpdate()
    {
      return Entities.WithChangeFilter<CardData>().ForEach(
      (Entity entity, ref CardData cardData) =>
      {
        EntityManager.GetComponentObject<CardBehaviour>(entity)
          .PlayUpdateAnimation(cardData);
      });
    }
  }

However, this is not possible because change filters are only allowed on JobComponentSystems (which I can’t use because GetComponentObject is not allowed inside Jobs).

It seems like the set of features available for a ComponentSystem ForEach is quite a bit smaller than what a JobComponentSystem can access – you can’t do “in”-typed parameters, and you can’t do change filters. Is there some specific reason for this limitation?

maybe this will help

This may or may not be useful solving a similar issue with subscene and live links

https://discussions.unity.com/t/765519/4

I am curious about this as well. I know it’s been like this ever since Unity introduced the change filter a year and a half ago. But some error handling (or at least a warning) would be good to let devs know of the limitations of this functionality.