Skip to content

Commit

Permalink
Reflect derived traits on all components and resources: bevy_ecs (#15215
Browse files Browse the repository at this point in the history
)

Solves #15187 for bevy_ecs
  • Loading branch information
blazepaws authored Sep 15, 2024
1 parent df8cb3e commit 53d2bc9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions crates/bevy_ecs/src/event/collections.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
use crate as bevy_ecs;
#[cfg(feature = "bevy_reflect")]
use bevy_ecs::reflect::ReflectResource;
use bevy_ecs::{
event::{Event, EventCursor, EventId, EventInstance},
system::Resource,
};
#[cfg(feature = "bevy_reflect")]
use bevy_reflect::Reflect;
use bevy_reflect::{std_traits::ReflectDefault, Reflect};
use bevy_utils::detailed_trace;
use std::marker::PhantomData;
use std::ops::{Deref, DerefMut};
Expand Down Expand Up @@ -85,7 +87,7 @@ use std::ops::{Deref, DerefMut};
/// [`EventWriter`]: super::EventWriter
/// [`event_update_system`]: super::event_update_system
#[derive(Debug, Resource)]
#[cfg_attr(feature = "bevy_reflect", derive(Reflect))]
#[cfg_attr(feature = "bevy_reflect", derive(Reflect), reflect(Resource, Default))]
pub struct Events<E: Event> {
/// Holds the oldest still active events.
/// Note that `a.start_event_count + a.len()` should always be equal to `events_b.start_event_count`.
Expand Down

0 comments on commit 53d2bc9

Please sign in to comment.