{"id":21577829,"url":"https://github.com/foxzool/bevy_activation","last_synced_at":"2025-08-05T11:23:06.788Z","repository":{"id":243621721,"uuid":"812915058","full_name":"foxzool/bevy_activation","owner":"foxzool","description":"A simple Entity activation manager for Bevy","archived":false,"fork":false,"pushed_at":"2024-11-30T09:47:53.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-24T15:11:13.710Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/foxzool.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-10T06:36:06.000Z","updated_at":"2024-11-30T09:47:57.000Z","dependencies_parsed_at":"2024-06-10T09:12:49.391Z","dependency_job_id":"c37cd13d-31fe-4262-a815-ef6816d782fc","html_url":"https://github.com/foxzool/bevy_activation","commit_stats":null,"previous_names":["foxzool/bevy_activation"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foxzool%2Fbevy_activation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foxzool%2Fbevy_activation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foxzool%2Fbevy_activation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/foxzool%2Fbevy_activation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/foxzool","download_url":"https://codeload.github.com/foxzool/bevy_activation/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248261993,"owners_count":21074229,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-24T13:08:44.310Z","updated_at":"2025-08-05T11:23:06.773Z","avatar_url":"https://github.com/foxzool.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bevy_activation\n\n[![Crates.io](https://img.shields.io/crates/v/bevy_activation)](https://crates.io/crates/bevy_activation)\n[![Downloads](https://img.shields.io/crates/d/bevy_activation)](https://crates.io/crates/bevy_activation)\n[![Documentation](https://docs.rs/bevy_activation/badge.svg)](https://docs.rs/bevy_activation)\n[![MIT/Apache 2.0](https://img.shields.io/badge/license-MIT%2FApache-blue.svg)](https://github.com/Seldom-SE/seldom_pixel#license)\n\nA simple HTTP client Bevy Plugin for both native and WASM.\n\n## Example\n\n``` no_run\nuse bevy::log::LogPlugin;\nuse bevy::prelude::*;\nuse bevy_activation::{ActivationPlugin, ActiveState, TimeoutEvent};\nuse std::time::Duration;\nuse bevy_time::common_conditions::on_timer;\n\nfn main() {\n    App::new()\n        .add_plugins(\n            MinimalPlugins.set(bevy::app::ScheduleRunnerPlugin::run_loop(\n                Duration::from_secs_f64(1.0 / 60.0),\n            )),\n        )\n        .add_plugins(LogPlugin::default())\n        .add_plugins(ActivationPlugin)\n        .add_systems(Startup, setup)\n        .add_systems(\n            Update,\n            (\n                check_active,\n                reactive_idle.run_if(on_timer(Duration::from_secs(5))),\n            ),\n        )\n        .run();\n}\n\n#[derive(Component)]\nstruct TestAlive(pub \u0026'static str);\n\nfn setup(mut commands: Commands) {\n    // this entity always active\n    commands.spawn((TestAlive(\"always alive component\"), ActiveState::default()));\n    // this entity will be active for 2 seconds\n    commands.spawn((\n        TestAlive(\"ttl 2 secs component\"),\n        ActiveState::new(Duration::from_secs(2)),\n    )).observe(on_timeout);\n}\n\nfn check_active(q: Query\u003c(\u0026TestAlive, \u0026ActiveState)\u003e) {\n    for (TestAlive(name), active_state) in q.iter() {\n        info!(\"'{}' active: {}\", name, active_state.is_active());\n    }\n}\n\n/// observe timeout event\nfn on_timeout(trigger: Trigger\u003cTimeoutEvent\u003e) {\n    warn!(\"entity {:?} timeout\", trigger.entity());\n}\n\n/// reactive idle component to active\nfn reactive_idle(mut q_idle: Query\u003c\u0026mut ActiveState\u003e) {\n    for mut active_state in q_idle.iter_mut() {\n        if active_state.is_idle() {\n            active_state.toggle();\n        }\n    }\n}\n```\n\n## Supported Versions\n\n| bevy | bevy_activation |\n|------|-----------------|\n| 0.16 | 0.4             |\n| 0.15 | 0.3             |\n| 0.14 | 0.2             |\n| 0.13 | 0.1             |\n\n## License\n\nDual-licensed under either:\n\n- [`MIT`](LICENSE-MIT): [http://opensource.org/licenses/MIT](http://opensource.org/licenses/MIT)\n- [`Apache 2.0`](LICENSE-APACHE): [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0)\n\nAt your option. This means that when using this crate in your game, you may choose which license to use.\n\nUnless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as\ndefined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffoxzool%2Fbevy_activation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffoxzool%2Fbevy_activation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffoxzool%2Fbevy_activation/lists"}