Open watch-janick opened 1 year ago
if you don't mind defining a max amount of effects you can do something like this:
const DynamicArrayComponent = defineComponent({
someDynamicArray: {
array: [f32, 12],
cursor: ui8,
}
})
const push = (darray, eid, value) => { darray.array[eid][darray.cursor[eid]++] = value }
push(DynamicArrayComponent.someDynamicArray, eid, 1)
I'm trying to build a component to store effects that can be applied on any character, think of it as a buff / debuff in a RPG game. How would you manage to add / remove those buffs / debuffs? Component:
System:
Thanks!