Bevy Easy Config
Bevy Easy Config is a plugin that allows you to load config files easily and instantiate them as a resource.
Usage
First define the struct that you would like to load, and impl/derive the relevant traits:
// Define the struct to load
// Default also needs to be implemented
The add it to your app:
use EasyConfigPlugin;
This will load the file located at assets/settings.ron, into the Settings struct and insert Settings as a resource.
Notices
Until the asset is loaded, when accessing the Settings resource, you will get the values from Settings::default().
As far as I know there isn't really a good way around this, so you will have to work with the default values for the
first few ticks, until the asset is loaded. When the asset is loaded, it will automatically replace the default values.
License
Dual-licensed under either:
- MIT License (LICENSE-MIT or http://opensource.org/licenses/MIT)
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
at your option.
Your contributions
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.