Search Unity

How to retrieve other classes fields from a ComponentSystem

Discussion in 'Data Oriented Technology Stack' started by Rs, Aug 31, 2019.

  1. Rs

    Rs

    Joined:
    Aug 14, 2012
    Posts:
    39
    Hello,
    I am starting to convert some projects to DOTS. Pretty late I know. I managed to setup a demo with thousands of boids using Entities and Jobs, achieving above 60fps with 50k entiites.
    My entities are just simple boids (classic). What I still don't get and can't find anything clear on the matter is how you get values from an instance of a class, for example a MonoBehaviour, to the system.
    Say all my boids must follow a common point (player, center, whatever), and I want all my boids to be aware of that value (that changes in time). How do I do that?
    I am sure I am not thinking the right way so I'd like to be pointed to the right direction. I would also like to expose some of these variables (shared among all boids) to the inspector, is it possible without using hybrid ECS?