https://github.com/coolcatcoder/bevy_registration
Run code on the app from far away.
https://github.com/coolcatcoder/bevy_registration
Last synced: over 1 year ago
JSON representation
Run code on the app from far away.
- Host: GitHub
- URL: https://github.com/coolcatcoder/bevy_registration
- Owner: coolcatcoder
- License: apache-2.0
- Created: 2025-01-06T00:44:52.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-01-29T23:08:48.000Z (over 1 year ago)
- Last Synced: 2025-01-30T00:18:38.273Z (over 1 year ago)
- Language: Rust
- Homepage: https://crates.io/crates/bevy_registration
- Size: 84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
# Bevy Registration
Annotate systems, resources, and events with macros and automatically add them to your app.
This uses [Inventory](https://crates.io/crates/inventory) internally, so it should work on Linux, macOS, iOS, FreeBSD, Android, Windows, and WebAssembly.
## Bevy Versions
| registration version | bevy version |
| -------------------- | ------------ |
| 0.1.0 - 0.2.4 | 0.15 |
## Example:
```rs
use bevy::prelude::*;
use bevy_registration::prelude::*;
// Initiates the resource on the app.
#[init]
#[derive(Resource, Default)]
pub struct TestResource;
// Adds the system to the Update schedule.
#[system(Update)]
fn resource_tester(resource: Option>) {
// This will not panic.
resource.unwrap();
}
fn main() {
App::new()
// Add bevy's default plugins, to start up the update loop.
.add_plugins(DefaultPlugins)
// Add the registration plugin that will collect the far-away app code.
.add_plugins(RegistrationPlugin)
.run();
}
```
## License
Licensed under either of
* Apache License, Version 2.0
([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
* MIT license
([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
at your option.
## Contribution
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.