Search Unity

how to write the ordered logic function in ECS?

Discussion in 'Data Oriented Technology Stack' started by ChiuanWei, Dec 21, 2018.

  1. ChiuanWei

    ChiuanWei

    Joined:
    Jan 29, 2012
    Posts:
    110
    because system react the data is changed.
    but how to write continue style logic in ecs ?

    like action game things like that :
    [
    1. move forward
    2. jump
    3. push
    4. wait 1 sec
    5. move back
    ]

    if the system are : movesytem,jumpsystem,pushsystem,waitsystem,movebacksystem,.....and ...

    but if i add the component of moveCom,jumpCom,pushCom,... in once time. the system comes run, right ??

    what's the best way to do the continue logic with system running ??
     
  2. ChiuanWei

    ChiuanWei

    Joined:
    Jan 29, 2012
    Posts:
    110
    :(
    or i need to write the ActionSystem to do things like:

    if moveend so add jump component .
    if jump is end add push component .
    and ....

    this sytem to contact all the component running like the React programming ? simple like the unirx does. ?

    if you got good ideas. please share . thanks guy.;)
     
  3. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    5,400
    Yes once the component tag is added, system become active. Then ensure, you remove This tag component in Tha system, from continuous execution. Also, make sure, that tag component don't hold any values.

    Regarding timing, you could have system with relevant tag, and it could execute, until time is expired. Then remove tag. Basically system would run only checks, until time comes, for. Logic execution. Just don't use While loop, to be clear.
     
  4. ChiuanWei

    ChiuanWei

    Joined:
    Jan 29, 2012
    Posts:
    110
    after i use the ecs
    i think its good to use XXLogicSystem to control how the component tag is remove and and another component ... untile the end.