-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
Description
Describe the bug
When language keywords like Event
are used as the name of a component, the code generator fails to handle the component name correctly.
To Reproduce
Generate code for the following component.
[Game]
public sealed class EventComponent : IComponent {
public MyEvent Event;
}
Generated code:
public partial class GameEntity {
public EventComponent event { get { return (EventComponent)GetComponent(GameComponentsLookup.Event); } }
// ...
}
Compilation error:
Assets\Generated\Game\Components\EventComponent.cs: error CS1519: Invalid token 'event' in class, record, struct, or interface member declaration
Potential Solution
Prefix the component name with a verbatim identifier @
if it is a language keyword. For example, event
becomes @event
.
Entitas Version
- Entitas 1.14.0