Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Using Subscene conversion for Prefabs

Discussion in 'Entity Component System' started by LazarusOfSuburbia, Jun 14, 2021.

  1. LazarusOfSuburbia

    LazarusOfSuburbia

    Joined:
    Jun 20, 2019
    Posts:
    3
    I've been setting up a project to dive into DOTS because it's been a couple years since I've really touched it. I understand how to do the old ways of things, through GeneratingAuthoringComponents and ConvertToEntitity monobehaviors. However, I have had a really hard time wrapping my head around subscene conversion, live linking, and how to use GameObjectConversionSystems within these Authoring Scenes.

    I've read through the [Unity Manual page](https://docs.unity3d.com/Packages/com.unity.entities@0.16/manual/conversion.html), but I'm having a lot of trouble tracking the exact workflow they're describing. They define a few terms, and provide some code samples, but it's very difficult for me to track how those pieces of the puzzle fit together. I would just use the old system, but the Unity Manual was very specific that they're deprecating that workflow and is not recommended.

    Does anyone have some resources or walkthroughs on how to implement the Authoring Scene workflow?

    For reference, I am doing a boid simulation that requires me to read in a Prefab GameObject, spawn them as Entities and then run Systems on those Entities.
     
  2. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,753
    Look int Unity samples on github. Study them and implement as you go.
    There is also boids example too.

    Either way, you are much better to build whole project from ground up, rather than trying to convert into DOTS with entities.
     
  3. exiguous

    exiguous

    Joined:
    Nov 21, 2010
    Posts:
    1,749
    I have asked a similar question some time ago. There is also a video linked comparing different conversion strategies (but not the workflow behind it). Maybe that helps.

    Note: I have not proceeded much further since ECS seems a bit too early for my taste. So I can't help with experience. But I'm interested in your findings too. Maybe in a year when it is supported in current Unity versions again, I may give it another try.