amethyst/legion

How to have optional component in system?

selvavm opened this issue · 2 comments

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);
   }
}

Thanks and sorry for creating an issue. I was referring only doc.rs for documentation so missed this. Have a good day