|
4 | 4 |
|
5 | 5 | ## Summary
|
6 | 6 |
|
| 7 | +### :sparkles: Dynamic Components |
| 8 | +To compliment dynamic systems introduced in the previous updates, scripts can now register their own, fully legit bevy components! |
| 9 | + |
| 10 | +```lua |
| 11 | +local NewComponent = world.register_new_component("ScriptComponentA") |
| 12 | + |
| 13 | +local new_entity = world.spawn() |
| 14 | +world.insert_component(new_entity, NewComponent, construct(types.DynamicComponent, { |
| 15 | + data = "Hello World" |
| 16 | +})) |
| 17 | + |
| 18 | +local component_instance = world.get_component(new_entity, NewComponent) |
| 19 | +assert(component_instance.data == "Hello World", "unexpected value: " .. component_instance.data) |
| 20 | + |
| 21 | +component_instance.data = { |
| 22 | + foo = "bar" |
| 23 | +} |
| 24 | + |
| 25 | +assert(component_instance.data.foo == "bar", "unexpected value: " .. component_instance.data.foo) |
| 26 | +``` |
| 27 | + |
| 28 | +These are backed by the `DynamicComponent` type which looks like this: |
| 29 | +```rust |
| 30 | +pub struct DynamicComponent { |
| 31 | + data: ScriptValue, |
| 32 | +} |
| 33 | +``` |
| 34 | +scripts can freely set this data payload to anything that is supported by `ScriptValue`'s !. |
| 35 | + |
| 36 | +These can also be queried as normal! |
| 37 | + |
| 38 | +### Mdbook Preprocessor Prettified |
| 39 | +The documentation you can generate via exported `ladfile`s now looks much better, types have nested links to other types, and things generally look better! |
| 40 | + |
| 41 | + |
| 42 | + |
| 43 | +### Continous Benchmarking |
| 44 | +BMS now runs and publishes the results of a variety of benchmarks over at [bencher](https://bencher.dev/console/projects/bms/plots) |
| 45 | + |
| 46 | +### Performance & Profiling Improvements |
| 47 | +You can now easilly profile BMS using the new `profile_with_tracy` feature which will also enable bevy's equivalent. Tracing spans have generally been improved, giving you lots of great detail into where most time is spent! |
| 48 | + |
| 49 | +The `get` and `set` indexer functions have been extracted into a `MagicFunctions` sub-registry to improve the performance of reflection. |
| 50 | + |
| 51 | +Various internal hashmaps have been tuned to get free performance wins. |
| 52 | + |
7 | 53 | ## Changelog
|
8 | 54 | See a detailed changelog [here](https://github.com/makspll/bevy_mod_scripting/blob/main/CHANGELOG.md)
|
9 | 55 |
|
|
0 commit comments