Search Unity

[0.5.0] Removed SetFilterChanged()

Discussion in 'Entity Component System' started by echeg, Jan 24, 2020.

  1. echeg

    echeg

    Joined:
    Aug 1, 2012
    Posts:
    90
    In ecs 0.5.0 removed SetFilterChanged()

    We have code like:

    Code (CSharp):
    1. public class ReactSys: ComponentSystem
    2. {
    3.   protected override void OnCreate()
    4.   {
    5. ...
    6.     _notifyGroup = GetEntityQuery(ComponentType.ReadOnly<TurnPhase>());
    7. // TurnPhase - singleton
    8.     _notifyGroup.SetFilterChanged(typeof(TurnPhase));
    9. ...
    10.   }
    11.  
    12.   protected override void OnUpdate()
    13.   {
    14.     // do some logic when TurnPhase change
    15. ...
    16.   }
    17. }
    After remove _notifyGroup.SetFilterChanged(typeof(TurnPhase));
    System "do some logic" every frame. before only when there was a change in value.

    What replacement is suggested instead SetFilterChanged? Manual Double buffer?

    P.S. we have arount ~100 EntityQuerys in project with SetFilterChanged
     
    OndrejP likes this.
  2. 5argon

    5argon

    Joined:
    Jun 10, 2013
    Posts:
    1,555
    It was renamed to SetChangedVersionFilter
     
    echeg likes this.