Search Unity

  1. 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
  2. Ever participated in one our Game Jams? Want pointers on your project? Our Evangelists will be available on Friday to give feedback. Come share your games with us!
    Dismiss Notice

Nested Entity Queries

Discussion in 'Data Oriented Technology Stack' started by Dakine83, May 24, 2020.

  1. Dakine83


    Jan 27, 2013
    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.