Some doc to bevy_diagnostic (#11020)

This commit is contained in:
Stepan Koltsov 2023-12-19 08:16:22 +00:00 committed by GitHub
parent d99053cc8a
commit 05b00267c6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 20 additions and 2 deletions

View file

@ -3,7 +3,11 @@ use bevy_ecs::entity::Entities;
use crate::{Diagnostic, DiagnosticId, Diagnostics, RegisterDiagnostic}; use crate::{Diagnostic, DiagnosticId, Diagnostics, RegisterDiagnostic};
/// Adds "entity count" diagnostic to an App /// Adds "entity count" diagnostic to an App.
///
/// # See also
///
/// [`LogDiagnosticsPlugin`](crate::LogDiagnosticsPlugin) to output diagnostics to the console.
#[derive(Default)] #[derive(Default)]
pub struct EntityCountDiagnosticsPlugin; pub struct EntityCountDiagnosticsPlugin;

View file

@ -5,6 +5,10 @@ use bevy_ecs::prelude::*;
use bevy_time::{Real, Time}; use bevy_time::{Real, Time};
/// Adds "frame time" diagnostic to an App, specifically "frame time", "fps" and "frame count" /// Adds "frame time" diagnostic to an App, specifically "frame time", "fps" and "frame count"
///
/// # See also
///
/// [`LogDiagnosticsPlugin`](crate::LogDiagnosticsPlugin) to output diagnostics to the console.
#[derive(Default)] #[derive(Default)]
pub struct FrameTimeDiagnosticsPlugin; pub struct FrameTimeDiagnosticsPlugin;

View file

@ -5,7 +5,13 @@ use bevy_log::{debug, info};
use bevy_time::{Real, Time, Timer, TimerMode}; use bevy_time::{Real, Time, Timer, TimerMode};
use bevy_utils::Duration; use bevy_utils::Duration;
/// An App Plugin that logs diagnostics to the console /// An App Plugin that logs diagnostics to the console.
///
/// Diagnostics are collected by plugins such as
/// [`FrameTimeDiagnosticsPlugin`](crate::FrameTimeDiagnosticsPlugin)
/// or can be provided by the user.
///
/// When no diagnostics are provided, this plugin does nothing.
pub struct LogDiagnosticsPlugin { pub struct LogDiagnosticsPlugin {
pub debug: bool, pub debug: bool,
pub wait_duration: Duration, pub wait_duration: Duration,

View file

@ -10,6 +10,10 @@ use bevy_app::prelude::*;
/// * macos /// * macos
/// ///
/// NOT supported when using the `bevy/dynamic` feature even when using previously mentioned targets /// NOT supported when using the `bevy/dynamic` feature even when using previously mentioned targets
///
/// # See also
///
/// [`LogDiagnosticsPlugin`](crate::LogDiagnosticsPlugin) to output diagnostics to the console.
#[derive(Default)] #[derive(Default)]
pub struct SystemInformationDiagnosticsPlugin; pub struct SystemInformationDiagnosticsPlugin;
impl Plugin for SystemInformationDiagnosticsPlugin { impl Plugin for SystemInformationDiagnosticsPlugin {