Open randomPoison opened 6 years ago
As this is less or more needed by or blocking https://github.com/randomPoison/amethyst-editor/issues/38, i can take care of this too.
Yup, you'll need to do both! The core functionality is implemented in amethyst-editor-sync
, and then you only need to add the corresponding UI elements to the Electron editor and have them send the right messages back to the game.
I made some progress in refactoring a lot of the code (after a lack in spare time to work on this) in general to do something like:
Receive editor input -> Update states -> read new states -> send updated data back to the editor
I will do some refactoring of the code base now too, and then add the few lines for entity creation/deleting too. I will make an PR this weekend regarding the first part for review, maybe the second too. :)
Add support for allowing the editor to request that a new entity be added to the game world.
IncomingMessage
calledCreateEntities
for requesting that an entity be created. The variant should carry a field specifying how many entities should be created."created_entities"
that is a list of any entities that were just created at the request of the editor.Similarly, to support destroying entities at runtime we'll need to add a variant to
IncomingMessage
calledDestroyEntities
that takes a list of entities to be destroyed. The list of destroyed entities does not need to be sent back to the editor, though.