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

GenerateAuthoringComponent doesn't support other attributes?

Discussion in 'Entity Component System' started by mr-gmg, Feb 25, 2020.

  1. mr-gmg

    mr-gmg

    Joined:
    Aug 31, 2015
    Posts:
    62
    Serializable or WriteGroup or probably other attributes as well
    Code (CSharp):
    1. [Serializable, GenerateAuthoringComponent]
    2. public struct MoveToTarget : IComponentData {
    3.     public float3 value;
    4. }
     
  2. siggigg

    siggigg

    Joined:
    Apr 11, 2018
    Posts:
    247
    It seems to do a text match. Leave it on its own and the bottom-most attribute and it should work.
     
    mr-gmg likes this.
  3. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    3,626
    As siggigg said

    Code (CSharp):
    1. // works
    2. [Serializable]  
    3. [GenerateAuthoringComponent]
    4. public struct MoveToTarget : IComponentData {
    5.         public float3 value;
    6. }
    7.  
    8. // does not work
    9. [GenerateAuthoringComponent]
    10. [Serializable]
    11. public struct MoveToTarget : IComponentData {
    12.         public float3 value;
    13. }
    14.  
    15.  
     
    mr-gmg likes this.
  4. mr-gmg

    mr-gmg

    Joined:
    Aug 31, 2015
    Posts:
    62
    thank you, it works as you said
     
    siggigg likes this.