Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions crates/bevy_app/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ use bevy_ecs::{
system::{ScheduleSystem, SystemId, SystemInput},
};
use bevy_platform::collections::HashMap;
#[cfg(feature = "bevy_reflect")]
use bevy_reflect::{FromType, Reflect, TypeData, TypePath};
use core::{fmt::Debug, num::NonZero, panic::AssertUnwindSafe};
use log::debug;

Expand Down Expand Up @@ -650,7 +652,7 @@ impl App {
}

/// Registers the type `T` in the [`AppTypeRegistry`] resource,
/// adding reflect data as specified in the [`Reflect`](bevy_reflect::Reflect) derive:
/// adding reflect data as specified in the [`Reflect`] derive:
/// ```ignore (No serde "derive" feature)
/// #[derive(Component, Serialize, Deserialize, Reflect)]
/// #[reflect(Component, Serialize, Deserialize)] // will register ReflectComponent, ReflectSerialize, ReflectDeserialize
Expand All @@ -666,7 +668,7 @@ impl App {
/// Associates type data `D` with type `T` in the [`AppTypeRegistry`] resource.
///
/// Most of the time [`register_type`](Self::register_type) can be used instead to register a
/// type you derived [`Reflect`](bevy_reflect::Reflect) for. However, in cases where you want to
/// type you derived [`Reflect`] for. However, in cases where you want to
/// add a piece of type data that was not included in the list of `#[reflect(...)]` type data in
/// the derive, or where the type is generic and cannot register e.g. `ReflectSerialize`
/// unconditionally without knowing the specific type parameters, this method can be used to
Expand All @@ -685,10 +687,7 @@ impl App {
///
/// See [`bevy_reflect::TypeRegistry::register_type_data`].
#[cfg(feature = "bevy_reflect")]
pub fn register_type_data<
T: bevy_reflect::Reflect + bevy_reflect::TypePath,
D: bevy_reflect::TypeData + bevy_reflect::FromType<T>,
>(
pub fn register_type_data<T: Reflect + TypePath, D: TypeData + FromType<T>>(
&mut self,
) -> &mut Self {
self.main_mut().register_type_data::<T, D>();
Expand Down Expand Up @@ -1486,6 +1485,11 @@ fn run_once(mut app: App) -> AppExit {
/// (see [`ExitCode`](https://doc.rust-lang.org/std/process/struct.ExitCode.html) and [`process::exit`](https://doc.rust-lang.org/std/process/fn.exit.html#))
/// we only allow error codes between 1 and [255](u8::MAX).
#[derive(Message, Debug, Clone, Default, PartialEq, Eq)]
#[cfg_attr(
feature = "bevy_reflect",
derive(Reflect),
reflect(Debug, PartialEq, Clone, Message)
)]
pub enum AppExit {
/// [`App`] exited without any problems.
#[default]
Expand Down