-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Problems
There are multiple small problems with entity creation in the LDtk Plugin:
- When using an
EntityIdentifierFactoryfor an entity-identifier, those entities are created in two different parts. Once whenLdtkResource.loadis called inEntityLayer.constructorand once onaddToSceneinrunFactories. Entities created whenloadis called are removed and replace whenaddToSceneis used. - Default entities are only created when
loadis called. It seems like they are reused instead of creating new ones when calling addToScene.
This is unexpected behavior for the user of the plugin.
Suggestion
- Remove the entitiy creation code from the
EntityLayer.constructor - Add the creation of default entities (if no
EntityIdentifierFactoryexists for that identifier) also toaddToScene[maybe inrunFactoriesas a fallback when no factory is found]
Open question
Are default entities really something a user would expect? Wouldn't it be better to simply print a warning, that no factory was found and so no entity was created? A warning would help the user to quickly know, that he forgot to add a EntityIdentifierFactory. An invisible default entity might cause issues, like "invisible" entities which affect collision.
eonarheim
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working