원클릭으로
bevy-resources
Reference for Bevy resources — defining, inserting, initializing, reading/writing, and removing global singleton data.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Reference for Bevy resources — defining, inserting, initializing, reading/writing, and removing global singleton data.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Reference for Avian physics engine — rigid bodies, colliders, joints, spatial queries, collision events, character controllers, and debug rendering.
Reference for loading, managing, and tracking assets in Bevy — AssetServer, handles, loading states, events, custom loaders, and hot reloading.
Reference for playing and controlling audio in Bevy — AudioPlayer, AudioSink, spatial audio, volume, and playback settings.
Reference for Bevy Scene Notation (BSN) — the bsn! macro for defining inline scenes with components, children, relationships, observers, and dynamic props.
Reference for cameras in Bevy — Camera2d, Camera3d, viewports, projection, render layers, mouse-to-world, and free camera controllers.
Reference for Bevy Commands — spawning/despawning entities, inserting/removing components, custom commands, trait extensions, and testing.
| name | bevy-resources |
| description | Reference for Bevy resources — defining, inserting, initializing, reading/writing, and removing global singleton data. |
| metadata | {"crate":"bevy_ecs","bevy":"0.19"} |
#[derive(Resource)]
struct Score(usize);
Only one per type per World.
// With an instance
app.insert_resource(Score(0));
// With Default or FromWorld
app.init_resource::<Score>();
Dynamic insertion from a system:
commands.insert_resource(Score(0));
commands.remove_resource::<Score>();
fn read(score: Res<Score>) { }
fn write(mut score: ResMut<Score>) {
score.0 += 1;
}
Avoid panics when resource might not exist:
fn maybe_score(mut score: Option<ResMut<Score>>) {
if let Some(mut score) = score.as_deref_mut() {
score.0 += 1;
}
}
Prefer init_resource at app definition over dynamic creation to ensure availability.