Add Cx helper to spawn observer
This is what I arrived at trying to move to the bevy_picking way of doing interactions. It ends up moving the observer setup out of the Element builder, for better or worse.
Usage looks something like this
```
let id = cx.create_entity();
cx.create_observer(move |_click: Trigger<Pointer<Click>>| { ... }, id, ())
Element::<Button>::for_entity(id)
```
合并状态:已合并 合并于 2024-12-30 关闭于 2024-12-30 1 条评论