# Bevy 引擎研究

* [Bevy](https://bevyengine.org/)
* [Bevy book](https://bevyengine.org/learn/book/getting-started/)
* [Bevy Engine](https://github.com/bevyengine/bevy) : A refreshingly simple data-driven game engine built in Rust

## App

* 配置全局数据 insert\_resource
* 配置 Systems
  * 初始化 add\_startup\_system
  * 主循环 add\_system
* 配置 Plugin
  * Plugin 是配置 App 其他操作的集合

### ECS

* Entity : Entity(u64)
* Component : #\[derive(Component)] struct S
* Resource ：全局单例数据，不属于 Entity
  * Event 特殊的一种全局数据，支持触发和响应
* System : 就是函数，支持特定的传入参数，没有返回值 fn(
  * Commands : 用来增加或删除 Entity 和 Resource
  * Query< ：用来查询和修改里的 Component 数据
    * \&Component,
    * \&mut Component,
    * With< Component>,
  * Res< S>>, ：查询和修改全局数据
    * ResMut< S>>){}

## Resource

* Bevy 资源管理分析


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://okzkx.gitbook.io/blogs/game-tech/engine/bevy.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
