mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
update doc/*/scripting/ecs.md
This commit is contained in:
parent
3c7b7a9318
commit
c023697bcc
2 changed files with 22 additions and 0 deletions
|
|
@ -38,6 +38,17 @@ entity:set_enabled(name: str, enable: bool)
|
|||
entity:get_player() -> int or nil
|
||||
```
|
||||
|
||||
## Custom Components
|
||||
|
||||
A component is defined as a script in `{pack}/scripts/components/{name}.lua`.
|
||||
The component will be available for use in the entity definition as `{pack}:{name}`.
|
||||
Example: `core:scripts/components/pathfinding.lua` -> `core:pathfinding`.
|
||||
|
||||
For **each** entity containing a component, a **separate instance** is created with **its own namespace** within the pack namespace.
|
||||
Global variables declared in it act as public fields of the component (same for global functions).
|
||||
|
||||
Entity components are specified via the ["components" list](../entity-properties.md#components)
|
||||
|
||||
## Built-in components
|
||||
|
||||
### Transform
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue