Search Unity

  1. Click here to see what's on sale for the "Best of Super Sale" on the Asset Store
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

[0.5.0] Removed SetFilterChanged()

Discussion in 'Data Oriented Technology Stack' started by echeg, Jan 24, 2020.

  1. echeg

    echeg

    Joined:
    Aug 1, 2012
    Posts:
    82
    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,511
    It was renamed to SetChangedVersionFilter
     
    echeg likes this.
unityunity