use bevy_asset::{Asset, Handle}; use bevy_ecs::{bundle::Bundle, component::Component}; use bevy_reflect::TypePath; use bevy_serde_lens::{ asset::{PathHandle, UniqueHandle}, BevyObject, ChildVec, DefaultInit, Maybe, }; use serde::{Deserialize, Serialize}; #[derive(Debug, Serialize, Deserialize, TypePath, Asset)] pub struct Image; #[derive(Debug, Serialize, Deserialize)] struct MySprite( f32, f32, f32, f32, #[serde(with = "PathHandle")] Handle, #[serde(with = "UniqueHandle")] Handle, PathHandle, UniqueHandle, ); #[derive(Debug, Component, Default)] struct A; #[derive(Debug, Component, Serialize, Deserialize, TypePath)] struct Aaa; #[derive(Debug, Component, Serialize, Deserialize, TypePath)] struct Bbb; #[derive(Debug, Component, Serialize, Deserialize, TypePath)] struct Ccc; #[derive(Debug, Default, Component, Serialize, Deserialize, TypePath)] struct Ddd; #[derive(Debug, Bundle, BevyObject)] struct Xa { a: Aaa, b: Bbb, c: Ccc, d: Ddd, } #[derive(Debug, Bundle, BevyObject)] #[bevy_object(query, rename = "xb")] struct Xb { a: Aaa, b: Bbb, c: Ccc, #[bevy_object(no_filter)] d: Ddd, } #[derive(Debug, BevyObject)] #[bevy_object(rename = "xb")] struct Xc { #[bevy_object(no_filter)] a: Aaa, #[serde(default)] b: Maybe, c: ChildVec, d: DefaultInit, } #[test] pub fn test() {}