bevyengine / bevy

A refreshingly simple data-driven game engine built in Rust
https://bevyengine.org
Apache License 2.0
36.46k stars 3.6k forks source link

Inserting Resource Tuples #16458

Open Wuketuke opened 1 week ago

Wuketuke commented 1 week ago

Objective

Some structs like Systems or Plugins can be inserted via tuple, but not Resources, which greatly annoyed me. Fixed #16398

Solution

I very closely copied what plugins do in bevy_app. I also modified every function signature relating to inserting Resources. However, I still have some open questions about my implementation:

Testing

I added an example in the documentation, and two new unit tests

alice-i-cecile commented 5 days ago

We've chatted about this before, and the SME-ECS (and Cart) aren't fully sold that this is worth the added compile time. To move forward here, you'll need to measure the impact.