Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Is it possible to access script created by GenerateAuthoringComponent

Discussion in 'Entity Component System' started by vectorized-runner, Jun 5, 2020.

  1. vectorized-runner

    vectorized-runner

    Joined:
    Jan 22, 2018
    Posts:
    383
    For example I need to display prefab values in the UI, but using GenerateAuthoringComponent prevents me from doing so and I need to create the authoring script myself, so I was wondering if is there a workaround?
     
  2. RoughSpaghetti3211

    RoughSpaghetti3211

    Joined:
    Aug 11, 2015
    Posts:
    1,695
    Can you use IConvertGameObjectToEntity?
     
  3. vectorized-runner

    vectorized-runner

    Joined:
    Jan 22, 2018
    Posts:
    383
    Yes I can but I liked not having to write one more script
     
  4. TRS6123

    TRS6123

    Joined:
    May 16, 2015
    Posts:
    246
    Last time I checked all generated authoring components are internal
     
    vectorized-runner likes this.
  5. joepl

    joepl

    Unity Technologies

    Joined:
    Jul 6, 2017
    Posts:
    85
    You should be able to view the generated code with the DOTS Compiler Inspector (DOTS -> DOTS Compiler -< Open Inspector). Your authoring component will have the same name as your original component with an "Authoring" suffix. If you copy out the C# from the inspector and copy it into a file (and remove the [GenerateAuthoringComponent] attribute) you can use the generated code as a starting point.
     
  6. Knedlo

    Knedlo

    Joined:
    Oct 15, 2012
    Posts:
    40
    In Unity 2021.3.6 i don't see any Open Inspector option under DOTS Compiler. How can I inspect the generated code then?