Fix type shenanigans

This commit is contained in:
DasLixou 2024-08-21 15:24:44 +02:00
parent cc71436187
commit 4d9c451de8
2 changed files with 13 additions and 5 deletions

View File

@ -124,15 +124,23 @@ const _: () = {
}
#[inline]
fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn ::core::any::Any> {
self
// this is changed
unsafe {
core::mem::transmute::<
::std::boxed::Box<Entity>,
::std::boxed::Box<bevy::ecs::entity::Entity>,
>(self)
}
}
#[inline]
fn as_any(&self) -> &dyn ::core::any::Any {
self
// this is changed
unsafe { core::mem::transmute::<&Entity, &bevy::ecs::entity::Entity>(self) }
}
#[inline]
fn as_any_mut(&mut self) -> &mut dyn ::core::any::Any {
self
// this is changed
unsafe { core::mem::transmute::<&mut Entity, &mut bevy::ecs::entity::Entity>(self) }
}
#[inline]
fn into_reflect(

View File

@ -1,7 +1,7 @@
use std::any::TypeId;
use bevy::log::{debug, warn};
use bevy::reflect::serde::ReflectDeserializer;
use bevy::log::{debug, info, warn};
use bevy::reflect::serde::{ReflectDeserializer, ReflectSerializer};
use bevy::reflect::{GetTypeRegistration, Reflect, TypeRegistration, TypeRegistry};
use bevy::utils::HashMap;
use ron::Value;