Search Unity

Nested Entity Queries

Discussion in 'Entity Component System' started by Dakine83, May 24, 2020.

  1. Dakine83

    Dakine83

    Joined:
    Jan 27, 2013
    Posts:
    1
    I've been trying to figure this issue out in a DOTS Appropriate way, but now I'm wondering if my plan of attack on this issue is correct at all.

    Essentially I have a component (gridData) that holds coordinates and information about those coordinates. Say, an X, Y, Z and what biome and how healthy the biome is.

    When I instantiate another entity, say a plant, I attach an initializeTag to it. In my initialize system, I had planned to loop through the initializeTag component entities and based on their translation data find the associated gridData entity and store a reference to it in a third component, LocationData. And then of course remove the initialize tag.

    What would be the best way to go about doing this? Is this even the right way to approach the problem? I could store my grid information in a regular 2 dimensional array and probably be fine, but I was trying to be fancy and use DOTS for it.

    I'm not overly concerned about multithreading this - entities won't be initialized with any huge frequency. But it seemed like a good exercise and this project really is just about playing with DOTS.

    Thanks!