bevyengine / bevyengine/bevy

Lifecycle API

Open
#2,432 14 comments 0 reactions 0 assignees View on GitHub
C-Feature S-Needs-Design-Doc
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 22h
Merged PRs (30d)
161

Description

## What problem does this solve or what need does it fill?

Android and XR apps often needs to keep track of the app lifecycle state and react differently to each of them. State-aware behavior is also often needed by backends an plugins implementations.

## What solution would you like?

Some alternatives are:

* `.add_*_system()`, where * is the name of a lifecycle state (or event). This follows the current `.add_startup_system()`.
* `.add_system(my_system.when::())`
* `.add_system_to_schedule(my_system, LifecycleState)`. `.add_system()` will be an alias for the running/steady state systems.

Possible names for the states:

* Startup/OnCreate/Enter
* Resume/OnResume/Resuming
* Update/Running
* Pause/OnPause/Pausing
* OnDestroy/Exit

User resources are available in all states, but engine provided resources might not be available in every state.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.