mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-10 13:31:49 +00:00
update doc/*/scripting/ecs.md
This commit is contained in:
parent
1fbf16e3dc
commit
ec5e447057
2 changed files with 6 additions and 2 deletions
|
|
@ -32,7 +32,9 @@ entity:require_component(name: str) -> component
|
||||||
-- Enables/disables the component
|
-- Enables/disables the component
|
||||||
entity:set_enabled(name: str, enable: bool)
|
entity:set_enabled(name: str, enable: bool)
|
||||||
|
|
||||||
-- Returns id of player the entity is bound
|
-- Returns id of player the entity is bound, otherwise -1 is returned.
|
||||||
|
-- At components initialization -1 is also returned,
|
||||||
|
-- since the binding occurs after initialization.
|
||||||
entity:get_player() -> int or nil
|
entity:get_player() -> int or nil
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,9 @@ entity:require_component(name: str) -> компонент
|
||||||
-- Включает/выключает компонент по имени
|
-- Включает/выключает компонент по имени
|
||||||
entity:set_enabled(name: str, enable: bool)
|
entity:set_enabled(name: str, enable: bool)
|
||||||
|
|
||||||
-- Возвращает id игрока, к которому привязана сущность
|
-- Возвращает id игрока, к которому привязана сущность, в ином же случае возвращает -1.
|
||||||
|
-- Во время инициализации компонентов при спавне сущности так же возвращает -1,
|
||||||
|
-- так как привязка происходит после инициализации.
|
||||||
entity:get_player() -> int или nil
|
entity:get_player() -> int или nil
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue