{"repo":"mintlu8/bevy_defer","free":true,"listed":false,"github":"https://github.com/mintlu8/bevy_defer","clone":"git clone https://github.com/mintlu8/bevy_defer.git","description":"A simple asynchronous runtime for executing async coroutines in the bevy engine.","language":"Rust","stars":92,"topics":["async","bevy","defer","reactivity","rust","ui","coroutine","futures"],"license":"Apache-2.0","category":"ui-components","readme_excerpt":"Bevy Defer A simple asynchronous runtime for executing async coroutines. Motivation bevy defer is an async runtime for bevy with world access. Think of a future in bevy defer as a Command that can take as long as it wants to complete. They can even wait for each other or pause for a few seconds, which is pretty powerful! So who needs bevy defer ? bevy defer is not for every use case as it is somewhat opposite to ecs s design goal. If your game is a lot of simple conditionals, ecs likely suits your need just fine. But if you have a game that does a lot of sequential actions or use a lot of complicated state machines, bevy defer might help you make your life easier. Common use cases Powerful Abstractions Pin in bevy defer is the strongest possible abstraction in bevy. Put that on a button's OnClick and it can do anything you want, much more powerful than a command or a system. Turn based gameplay and event orchestration In turn based games, you generally want to sequence actions after the player's input. in bevy defer this is incredibly simple: UI reactivity bevy defer provides an alternative model to handle reactivity using async rust. Getting Started First add AsyncPlugin If you want to react to events, states, or other things, add their corresponding react to functions. Spawning a Task You can spawn a task onto bevy defer from World , App , Commands , AsyncWorld or AsyncExecutor . Here is an example: Accessing the world The entry point of all world access is AsyncWorld , for","default_branch":null,"files":null,"tree":[],"storefront":"/r/mintlu8","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/mintlu8/bevy_defer/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}