MrGVSV / bevy_proto

Create config files for entities in Bevy
Other
239 stars 25 forks source link

Add custom configs and custom loaders #41

Closed MrGVSV closed 1 year ago

MrGVSV commented 1 year ago

Problem

In order to allow proper customization and configuration, prototypes need to be separated from the config that controls them. Furthermore, the loading behavior needs to be split from the prototype and the config so we can avoid issues related to ownership and async.

Solution

Custom Config

Split the configuration type out of Prototypical so a prototype can be controlled by a custom config type. This means that users can choose between adding callbacks to ProtoConfig or rolling out their own Config type for even more control.

See example for usage.

Custom Loader

Users can now supply their own Loader types to the plugin. This can be used to handle deserialization and pre-processing of prototype assets during the load phase.

See example for usage.