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
// does not work#[derive(Reflect)]pubstructDurationInput(f32);implFrom<DurationInput>forDuration{fnfrom(value:DurationInput) -> Self{Duration::from_secs_f32(value.0)}}#[derive(Component,Reflect,Schematic)]#[reflect(Schematic)]pubstructFoo{bars:Vec<Bar>,}#[derive(Reflect,Schematic)]#[reflect(Schematic)]pubstructBar{#[schematic(from = DurationInput)]duration:Duration,#[schematic(asset)]handle:Handle<Baz>,}
While the first example works, as soon as you add more complex types to Bar such as a Handle or Duration like in the second example, serialization will fail because the #[schematic] attributes are not respected. Another issue is that Bar has to derive Component, which might not make sense in a context where it is only used inside of Foo and not as a component itself.
The text was updated successfully, but these errors were encountered:
Currently nested schematics are really restrictive.
While the first example works, as soon as you add more complex types to
Bar
such as aHandle
orDuration
like in the second example, serialization will fail because the#[schematic]
attributes are not respected. Another issue is thatBar
has to deriveComponent
, which might not make sense in a context where it is only used inside ofFoo
and not as a component itself.The text was updated successfully, but these errors were encountered: