Fixing some doc comments (#9646)
# Objective I've been collecting some mistakes in the documentation and fixed them --------- Co-authored-by: Emi <emanuel.boehm@gmail.com> Co-authored-by: Nicola Papale <nicopap@users.noreply.github.com>
This commit is contained in:
parent
11567b31f9
commit
3527288342
@ -241,8 +241,8 @@ pub struct AnimationPlayer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl AnimationPlayer {
|
impl AnimationPlayer {
|
||||||
/// Start playing an animation, resetting state of the player
|
/// Start playing an animation, resetting state of the player.
|
||||||
/// This will use a linear blending between the previous and the new animation to make a smooth transition
|
/// This will use a linear blending between the previous and the new animation to make a smooth transition.
|
||||||
pub fn start(&mut self, handle: Handle<AnimationClip>) -> &mut Self {
|
pub fn start(&mut self, handle: Handle<AnimationClip>) -> &mut Self {
|
||||||
self.animation = PlayingAnimation {
|
self.animation = PlayingAnimation {
|
||||||
animation_clip: handle,
|
animation_clip: handle,
|
||||||
@ -256,8 +256,8 @@ impl AnimationPlayer {
|
|||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Start playing an animation, resetting state of the player
|
/// Start playing an animation, resetting state of the player.
|
||||||
/// This will use a linear blending between the previous and the new animation to make a smooth transition
|
/// This will use a linear blending between the previous and the new animation to make a smooth transition.
|
||||||
pub fn start_with_transition(
|
pub fn start_with_transition(
|
||||||
&mut self,
|
&mut self,
|
||||||
handle: Handle<AnimationClip>,
|
handle: Handle<AnimationClip>,
|
||||||
|
|||||||
@ -146,7 +146,7 @@ impl<T: Asset> Assets<T> {
|
|||||||
/// Get mutable access to the asset for the given handle.
|
/// Get mutable access to the asset for the given handle.
|
||||||
///
|
///
|
||||||
/// This is the main method for mutably accessing asset data from an [Assets] collection. If you
|
/// This is the main method for mutably accessing asset data from an [Assets] collection. If you
|
||||||
/// do not need mutable access to the asset, you may also use [get](Assets::get).
|
/// do not need mutable access to the asset, you may also use [`get`](Assets::get).
|
||||||
pub fn get_mut(&mut self, handle: &Handle<T>) -> Option<&mut T> {
|
pub fn get_mut(&mut self, handle: &Handle<T>) -> Option<&mut T> {
|
||||||
let id: HandleId = handle.into();
|
let id: HandleId = handle.into();
|
||||||
self.events.send(AssetEvent::Modified {
|
self.events.send(AssetEvent::Modified {
|
||||||
|
|||||||
@ -53,7 +53,7 @@ impl VolumeLevel {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// How should Bevy manage the sound playback?
|
/// The way Bevy manages the sound playback.
|
||||||
#[derive(Debug, Clone, Copy)]
|
#[derive(Debug, Clone, Copy)]
|
||||||
pub enum PlaybackMode {
|
pub enum PlaybackMode {
|
||||||
/// Play the sound once. Do nothing when it ends.
|
/// Play the sound once. Do nothing when it ends.
|
||||||
|
|||||||
@ -68,7 +68,7 @@ impl AssetLoader for AudioLoader {
|
|||||||
/// in order to be registered.
|
/// in order to be registered.
|
||||||
/// Types that implement this trait usually contain raw sound data that can be converted into an iterator of samples.
|
/// Types that implement this trait usually contain raw sound data that can be converted into an iterator of samples.
|
||||||
/// This trait is implemented for [`AudioSource`].
|
/// This trait is implemented for [`AudioSource`].
|
||||||
/// Check the example `audio/decodable` for how to implement this trait on a custom type.
|
/// Check the example [`decodable`](https://github.com/bevyengine/bevy/blob/latest/examples/audio/decodable.rs) for how to implement this trait on a custom type.
|
||||||
pub trait Decodable: Send + Sync + 'static {
|
pub trait Decodable: Send + Sync + 'static {
|
||||||
/// The type of the audio samples.
|
/// The type of the audio samples.
|
||||||
/// Usually a [`u16`], [`i16`] or [`f32`], as those implement [`rodio::Sample`].
|
/// Usually a [`u16`], [`i16`] or [`f32`], as those implement [`rodio::Sample`].
|
||||||
|
|||||||
@ -1,12 +1,9 @@
|
|||||||
//! Extension to [`EntityCommands`] to modify [`bevy_hierarchy`] hierarchies
|
//! Extension to [`EntityCommands`] to modify `bevy_hierarchy` hierarchies
|
||||||
//! while preserving [`GlobalTransform`].
|
//! while preserving [`GlobalTransform`].
|
||||||
|
|
||||||
use bevy_ecs::{prelude::Entity, system::Command, system::EntityCommands, world::World};
|
use bevy_ecs::{prelude::Entity, system::Command, system::EntityCommands, world::World};
|
||||||
use bevy_hierarchy::{AddChild, RemoveParent};
|
use bevy_hierarchy::{AddChild, RemoveParent};
|
||||||
|
|
||||||
#[cfg(doc)]
|
|
||||||
use bevy_hierarchy::BuildChildren;
|
|
||||||
|
|
||||||
use crate::{GlobalTransform, Transform};
|
use crate::{GlobalTransform, Transform};
|
||||||
|
|
||||||
/// Command similar to [`AddChild`], but updating the child transform to keep
|
/// Command similar to [`AddChild`], but updating the child transform to keep
|
||||||
@ -63,13 +60,13 @@ impl Command for RemoveParentInPlace {
|
|||||||
update_transform();
|
update_transform();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/// Collection of methods similar to [`BuildChildren`], but preserving each
|
/// Collection of methods similar to [`BuildChildren`](bevy_hierarchy::BuildChildren), but preserving each
|
||||||
/// entity's [`GlobalTransform`].
|
/// entity's [`GlobalTransform`].
|
||||||
pub trait BuildChildrenTransformExt {
|
pub trait BuildChildrenTransformExt {
|
||||||
/// Change this entity's parent while preserving this entity's [`GlobalTransform`]
|
/// Change this entity's parent while preserving this entity's [`GlobalTransform`]
|
||||||
/// by updating its [`Transform`].
|
/// by updating its [`Transform`].
|
||||||
///
|
///
|
||||||
/// See [`BuildChildren::set_parent`] for a method that doesn't update the
|
/// See [`BuildChildren::set_parent`](bevy_hierarchy::BuildChildren::set_parent) for a method that doesn't update the
|
||||||
/// [`Transform`].
|
/// [`Transform`].
|
||||||
///
|
///
|
||||||
/// Note that both the hierarchy and transform updates will only execute
|
/// Note that both the hierarchy and transform updates will only execute
|
||||||
@ -80,7 +77,7 @@ pub trait BuildChildrenTransformExt {
|
|||||||
/// Make this entity parentless while preserving this entity's [`GlobalTransform`]
|
/// Make this entity parentless while preserving this entity's [`GlobalTransform`]
|
||||||
/// by updating its [`Transform`] to be equal to its current [`GlobalTransform`].
|
/// by updating its [`Transform`] to be equal to its current [`GlobalTransform`].
|
||||||
///
|
///
|
||||||
/// See [`BuildChildren::remove_parent`] for a method that doesn't update the
|
/// See [`BuildChildren::remove_parent`](bevy_hierarchy::BuildChildren::remove_parent) for a method that doesn't update the
|
||||||
/// [`Transform`].
|
/// [`Transform`].
|
||||||
///
|
///
|
||||||
/// Note that both the hierarchy and transform updates will only execute
|
/// Note that both the hierarchy and transform updates will only execute
|
||||||
|
|||||||
@ -63,10 +63,10 @@ use crate::web_resize::{CanvasParentResizeEventChannel, CanvasParentResizePlugin
|
|||||||
#[cfg(target_os = "android")]
|
#[cfg(target_os = "android")]
|
||||||
pub static ANDROID_APP: std::sync::OnceLock<AndroidApp> = std::sync::OnceLock::new();
|
pub static ANDROID_APP: std::sync::OnceLock<AndroidApp> = std::sync::OnceLock::new();
|
||||||
|
|
||||||
/// A [`Plugin`] that uses [`winit`] to create and manage windows, and receive window and input
|
/// A [`Plugin`] that uses `winit` to create and manage windows, and receive window and input
|
||||||
/// events.
|
/// events.
|
||||||
///
|
///
|
||||||
/// This plugin will add systems and resources that sync with the [`winit`] backend and also
|
/// This plugin will add systems and resources that sync with the `winit` backend and also
|
||||||
/// replace the exising [`App`] runner with one that constructs an [event loop](EventLoop) to
|
/// replace the exising [`App`] runner with one that constructs an [event loop](EventLoop) to
|
||||||
/// receive window and input events from the OS.
|
/// receive window and input events from the OS.
|
||||||
#[derive(Default)]
|
#[derive(Default)]
|
||||||
|
|||||||
@ -21,7 +21,7 @@ use crate::{
|
|||||||
converters::{convert_enabled_buttons, convert_window_level, convert_window_theme},
|
converters::{convert_enabled_buttons, convert_window_level, convert_window_theme},
|
||||||
};
|
};
|
||||||
|
|
||||||
/// A resource mapping window entities to their [`winit`]-backend [`Window`](winit::window::Window)
|
/// A resource mapping window entities to their `winit`-backend [`Window`](winit::window::Window)
|
||||||
/// states.
|
/// states.
|
||||||
#[derive(Debug, Default)]
|
#[derive(Debug, Default)]
|
||||||
pub struct WinitWindows {
|
pub struct WinitWindows {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user