Search Unity

Injected MonoBehaviors, Callbacks, and ECS Systems

Discussion in 'Entity Component System' started by TheGabelle, Nov 12, 2020.

  1. TheGabelle

    TheGabelle

    Joined:
    Aug 23, 2013
    Posts:
    242
    I am currently experimenting with the new runtime UI system and really enjoy it so far. I convert and inject the GameObject so I can easily access the UI Document and Event System (UI Toolkit) MonoBehaviours in an Entities query without burst on the main thread. I'm stuck on UI events, more explicitly I don't know how to handle the event callbacks so I can have systems process events. An example of what I'm trying to achieve: a system that syncs dirty UI data with a respective Entity component and vice versa.

    I also don't know when injected MonoBehaviours get their Update methods invoked, or where this process fits within the system scheduling.
     
  2. brunocoimbra

    brunocoimbra

    Joined:
    Sep 2, 2015
    Posts:
    679
    In the Systems window, click to show the entire PlayerLoop, this will make clear when things happen
     
  3. DK_A5B

    DK_A5B

    Joined:
    Jan 21, 2016
    Posts:
    110
    Just as a quick add to this, the "Show Full Player Loop" option is only available once you've hit Play (at least w/ Unity 2020.20b11 and DOTS Editor 0.11.0-preview.16):

    upload_2020-11-12_10-18-24.png

    Before you hit Play, the option menu isn't available:
    upload_2020-11-12_10-19-4.png