Search Unity

Where is the bootstrap in twostickspure?

Discussion in 'Entity Component System' started by laurentlavigne, Oct 22, 2018.

  1. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,335
    The only mono I see is the settings, how does this scene starts?
     
  2. nttLIVE

    nttLIVE

    Joined:
    Sep 13, 2018
    Posts:
    80
  3. jonathan_lbs

    jonathan_lbs

    Joined:
    Oct 18, 2018
    Posts:
    1
  4. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,335
    This script isn't in the scene so how does this attribute knows that it's this scene and not another one?
     
  5. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    3,759
    It doesn't. It'll run in any scene. But for pure ECS having multiple scenes often doesn't make much sense except to load in data asynchronously.
     
  6. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,335
    There are 4 bootstrap scripts in the sample project, so all 4 run when I press play in the boid scene?
     
  7. nttLIVE

    nttLIVE

    Joined:
    Sep 13, 2018
    Posts:
    80
    As long as they have the RuntimeInitializeOnLoadMethodAttribute yes. You can have as many bootstraps as you want really. I use one to initialize network systems and another one for combat systems.
     
    Last edited: Oct 23, 2018
  8. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,335
    Are there benefits to using this vs using awake?
     
  9. nttLIVE

    nttLIVE

    Joined:
    Sep 13, 2018
    Posts:
    80
    I guess the main point is to not have to use a GameObject to initialize but I don't think there's a specific pro or con.

    If you want to go full Pure ECS then you wouldn't want to use a GO right?

    You can also start initializing before the scene loads.
     
    Last edited: Oct 23, 2018
  10. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,335
    Thanks.
    I'll use Awake and multi scene, I am sure there is a benefit in term of bootup time but I like seeing the entry point to my scene logic.