Update component-traits.md

This commit is contained in:
ChinoUkaegbu 2024-11-17 11:28:38 +01:00 committed by GitHub
parent 52bad8137d
commit ffa107353e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -102,7 +102,7 @@ world:add(Archer, pair(jecs.OnDelete, jecs.Delete))
local e = world:entity()
world:add(e, Archer)
-- This will delete entity e
-- This will delete entity e because the Archer component has a (OnDelete, Delete) cleanup trait
world:delete(Archer)
```
@ -113,7 +113,7 @@ world.add(Archer, pair(jecs.OnDelete, jecs.Delete))
const e = world:entity()
world.add(e, Archer)
// This will delete entity e
// This will delete entity e because the Archer component has a (OnDelete, Delete) cleanup trait
world.delete(Archer)
```