You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The doc states, that SingletonPlugin throws exception when an entity enters the world with a @Singleton component.
I made a singleton component, but have not yet added systems that use it (e.g. that want to inject the component into the field). Then I tried to create an entity with the component. I expected it to throw exception, but it worked fine. Here is a kotlin snippet:
@Singleton
classGameMapComponent {
privateval map:GameMap
}
// ...
world =World(WorldConfigurationBuilder()
.with(SingletonPlugin()) // no other systems added
.build())
val entity = world.create()
val mapComponent = world
.getMapper(GameMapComponent::class.java)
.create(entity)
The text was updated successfully, but these errors were encountered:
acanthite1855
changed the title
SingletonPlugin won't throw exception in strict mode if no system injects the component
SingletonPlugin won't throw exception in strict mode if no system uses the component
Dec 23, 2020
The doc states, that
SingletonPlugin
throws exception when an entity enters the world with a@Singleton
component.I made a singleton component, but have not yet added systems that use it (e.g. that want to inject the component into the field). Then I tried to create an entity with the component. I expected it to throw exception, but it worked fine. Here is a kotlin snippet:
The text was updated successfully, but these errors were encountered: