Search Unity

  1. Calling all beginners! Join the FPS Beginners Mods Challenge until December 13.
    Dismiss Notice
  2. It's Cyber Week at the Asset Store!
    Dismiss Notice

Is there a tutorial/document/thread that explains how AuthoringComponents are intended to work?

Discussion in 'Data Oriented Technology Stack' started by alexchesser, Sep 1, 2019.

  1. alexchesser

    alexchesser

    Joined:
    Sep 15, 2017
    Posts:
    35
    Hi there,

    I’m specifically looking at the IConvertGameObjectToEntity you get from the Create -> ECS -> Authoring Component Type template. How would one use this within a pure ECS build? What concrete examples of things would I use this for?

    Would I (for example) create a prefab "small health potion" and attach an AuthoringComponent with a serializable field for ‘heal amount’. So I could create a series of items in the editor where game designers might be able to edit parameters without requiring code?

    Sorry if that isn’t clear, i’m Maybe a little confused about the reasons this component template has been added and the optimal intended uses for it.
     
  2. DreamingImLatios

    DreamingImLatios

    Joined:
    Jun 3, 2017
    Posts:
    660
    Exactly!

    Not just prefabs, you can also use it for all custom data on all your scene GameObjects and then drop all those GameObjects into a subscene. Unity will convert the subscene to Entities and bake the result into a binary file so that on game load the game doesn't have to convert all those entities.
     
  3. RecursiveEclipse

    RecursiveEclipse

    Joined:
    Sep 6, 2018
    Posts:
    103