You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// Creates a new [`MoveBundle`] with given source and target IDs.
792
+
pubfnnew(source:Entity,target:Entity) -> Self{
793
+
Self{
794
+
source,
795
+
target,
796
+
_bundle:PhantomData,
797
+
}
798
+
}
799
+
}
800
+
801
+
impl<T>CommandforMoveBundle<T>
802
+
where
803
+
T:Bundle + 'static,
804
+
{
805
+
fnwrite(self,world:&mutWorld){
806
+
let bundle_opt = ifletSome(mut source) = world.get_entity_mut(self.source){
807
+
source.remove_bundle::<T>()
808
+
}else{
809
+
panic!("Could not move a bundle (of type `{}`) from entity {:?} because it doesn't exist in this World.\n\
810
+
If this command was added to a newly spawned entity, ensure that you have not despawned that entity within the same stage.\n\
811
+
This may have occurred due to system order ambiguity, or if the spawning system has multiple command buffers", std::any::type_name::<T>(),self.source);
panic!("Could not move a bundle (of type `{}`) to entity {:?} because it doesn't exist in this World.\n\
824
+
If this command was added to a newly spawned entity, ensure that you have not despawned that entity within the same stage.\n\
825
+
This may have occurred due to system order ambiguity, or if the spawning system has multiple command buffers", std::any::type_name::<T>(),self.target);
0 commit comments