Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

sanity check

Discussion in 'Entity Component System' started by RoughSpaghetti3211, Oct 17, 2019.

  1. RoughSpaghetti3211

    RoughSpaghetti3211

    Joined:
    Aug 11, 2015
    Posts:
    1,697
    Need .a sanity check, cant see why ForEach delegate is not running inside my GameObjectConversionSystem

    Debug.Log(grp.CalculateEntityCount()); // RETURNS 12

    Code (CSharp):
    1.            
    2.  
    3. EntityQuery grp = this.DstEntityManager.CreateEntityQuery(typeof(TilePositionComponents),
    4.                                                              typeof(TileConnnectedTrisComponents));
    5.             Debug.Log(grp.CalculateEntityCount()); // RETURNS 12
    6.             this.Entities.With(grp).ForEach((Entity e, ref TileConnnectedTrisComponents c) =>
    7.             {
    8.                 Debug.Log("_____");
    9.                 Debug.Log(c.ConnectedTriA);
    10.             });
    11.  
     
  2. M_R

    M_R

    Joined:
    Apr 15, 2015
    Posts:
    559
    the EQ is from the destination world.
    the ForEach is running on the conversion world
     
    Sylmerria likes this.
  3. RoughSpaghetti3211

    RoughSpaghetti3211

    Joined:
    Aug 11, 2015
    Posts:
    1,697
    Ahhhh thank you !! I Feel stupid thanks again