mirror of
https://github.com/Ukendio/jecs.git
synced 2025-04-25 01:20:04 +00:00
Update component-traits.md
This commit is contained in:
parent
52bad8137d
commit
ffa107353e
1 changed files with 2 additions and 2 deletions
|
@ -102,7 +102,7 @@ world:add(Archer, pair(jecs.OnDelete, jecs.Delete))
|
||||||
local e = world:entity()
|
local e = world:entity()
|
||||||
world:add(e, Archer)
|
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)
|
world:delete(Archer)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -113,7 +113,7 @@ world.add(Archer, pair(jecs.OnDelete, jecs.Delete))
|
||||||
const e = world:entity()
|
const e = world:entity()
|
||||||
world.add(e, Archer)
|
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)
|
world.delete(Archer)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue