1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//! # camera.rs
//!
//! # camera.rs 文件
//!
//! ## Module Overview
//!
//! ## 模块概述
//!
//! This module provides camera control systems, especially for followable cameras.
//!
//! 该模块提供面向可跟随摄像机的控制系统。
//!
//! ## Source File Overview
//!
//! ## 源文件概述
//!
//! It defines `CameraPlugin`, which updates and manages the camera systems.
//!
//! 本文件定义了负责更新与管理摄像机系统的 `CameraPlugin`。
pub(crate) mod components;
mod systems;
pub(crate) use components::*;
pub use systems::CameraUpdateSet;
use bevy::app::{App, Plugin, Update};
use bevy::prelude::IntoScheduleConfigs;
pub(crate) struct CameraPlugin;
impl Plugin for CameraPlugin {
fn build(&self, app: &mut App) {
use systems::*;
// Configure CameraUpdateSet to run in Update schedule.
// Other systems can use .before(CameraUpdateSet) to ensure they run first.
//
// 配置 CameraUpdateSet 在 Update 调度中运行。
// 其他系统可以使用 .before(CameraUpdateSet) 确保它们先运行。
app.configure_sets(Update, CameraUpdateSet).add_systems(
Update,
update_followable_camera_system.in_set(CameraUpdateSet),
);
}
}