Closed woshiZS closed 1 year ago
We've done this in our project. I can't recall how we handled it exactly off the top of my head, and I'm leaving for vacation in the morning.
If you haven't gotten your solution in 1 week, remind me and I'll share our approach.
@woshiZS when you use entity.ReplaceMyComponent(teamId, other, properties)
it should always update the index.
This is fine to do and will also reuse the components itself.
You can also consider to have less properties per component, e.g.
public sealed class TeamIdComponent : IComponent {
[EntityIndex]
public long Value;
}
btw, you don't need get and set. I would recommend to get rid of those, unless you need them for sth
Hi,
I am wondering if there is a way to change a property of my component and update the index of that property.
Here's some code
If I just change value of
TeamId
, the index will not be notified by the group. Instead I need to replace or remove the correspoding componet so that the Index will refreshed. Is there a easier way to notify my index without removing or replacing other properties? Cheers