Search Issue Tracker

Fixed in 0.17.0-preview.25

Votes

0

Found in [Package]

0.3.0-preview.4, 0.6.0-preview.24

Issue ID

1213983

Regression

No

[ECS] MonoBehaviour Authoring class is overridden in the Inspector when struct with GenerateAuthoringComponent attribute is used

Package: Entity Component System (ECS)

-

How to reproduce:
1. Open the user's project ("Samples.zip")
2. Select SubScene/Cylinder GameObject from the Hierarchy
4. Inspect that it has "Fly Away Tag Authoring" script attached in the Inspector

Expected results: MonoBehaviour Authoring class is not overridden (or warnings/errors are thrown in the console regarding it)
Actual results: MonoBehaviour Authoring class is overridden

Reproducible with: 2019.3.3f1, 2020.1.0a25
Couldn't test with 2017.4, 2018.4 (required package versions not supported)
Reproducible with package versions: 0.3.0-preview.4, 0.6.0-preview.24

Note: Commenting out the GenerateAuthoringComponent fixes the issue (CrossSpawnerAuthoring.cs line 39)

  1. Resolution Note (fix version 0.17.0-preview.25):

    Fixing this issue would lead to significant performance regressions, because it entails iterating through all the types contained within an assembly and then checking whether they share the same names as the generated authoring types. The real fix here is updated documentation:
    "Generated authoring types will overwrite existing types with the same names. E.g., if you have an IComponentData type named MyAwesomeComponent with the [GenerateAuthoringComponent] attribute, your own implementation of MyAwesomeComponentAuthoring will be overwritten by the generated MyAwesomeComponentAuthoring."

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.