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

Using ExclusiveEntityTransaction API in Different Threads.

Discussion in 'Entity Component System' started by Opeth001, Jun 14, 2019.

  1. Opeth001

    Opeth001

    Joined:
    Jan 28, 2017
    Posts:
    1,112
    I'm trying to generate a map from a Dictionary<int, List<PosRotScal>> so each id represents a prefab stored as an addressable.
    What i would like to do is creating an entity from each returned addressable prefab then in a different thread instantiate thousands of entities and fill their Pos Rot Scale. So im thinking about taking advantage of the ExclusiveEntityTransaction but I didn't found how to use it in parallel I'm not even sure if it's possible.

    the second way im thinking about is creating a different world foreach entity type and then merge them all.
    if someone has any suggestion it will be awesome!
     
  2. Opeth001

    Opeth001

    Joined:
    Jan 28, 2017
    Posts:
    1,112
    im also facing a problem to set a SharedComponentData called "Region" to my entities instantiated inside jobs.
    knowing that Regions are just simple blittable int2, is there any way to add them to my entities within jobs ?