How to have optional component in system?
selvavm opened this issue · 2 comments
selvavm commented
Hi,
Is it possible to do similar to below? I wanted to trigger a system with or without B
#[system]
fn hello_world(a: &A, b: &mut Option<B>) {
if let Some(b) = b {
println!("Both A and B is present: A={} and B={}", &a.value, &b.value);
} else {
println!("Only A is present: A={}", &a.value);
}
}
FluffyCreature commented
Yes it is! Please refer to: https://amethyst.rs/posts/legion-ecs-v0.3
selvavm commented
Thanks and sorry for creating an issue. I was referring only doc.rs for documentation so missed this. Have a good day