vleue / bevy_easings

Bevy plugin for easings and simple animations
181 stars 28 forks source link

method to avoid code duplication with initial component value #37

Closed Vrixyz closed 5 months ago

Vrixyz commented 5 months ago

I found it a bit counterintuitive to be forced to add a "placeholder" component only to have it "replaced immediately", so I did a helper function to help with that.

It might not be worth the added cognitive load of an additional function hiding "complexity", but this pattern has helped me with bigger components where in practice I had to declare it above the spawn, then clone it, or implement default.

mockersf commented 5 months ago

clippy failure not related

mockersf commented 5 months ago

thanks!