Open cchandel opened 1 year ago
Now it's running correctly. This bug was caused by incorrect deletion order in the API.
func (e *EntityInfo) Destroy(world IWorld) {
for i := 0; i < len(e.compound); i++ {
world.deleteComponentByIntType(e.entity, e.compound[i])
}
// must be last
world.deleteEntity(e.entity)
}
Adjust API to no longer export EntityInfo, All operations should be obtained through SyncWrapper.
world.Sync(func(gaw SyncWrapper) error {
u, ok := GetUtility[__world_Test_U_Input](gaw)
if !ok {
return errors.New("utility not found")
}
gaw.DestroyEntity(entities[1])
return nil
})
Hi, I'm creatng an entity in an asyncworld as below.
then deleting the entity by
After Destroying, the entity remains available when doing :-
Please help.