Component:entity

Returns the Entity this component belongs to.

Usage

component:entity()

Returns

Name Type Description
entity Entity Entity this component belongs to.

Examples

local ecs = crystal.ECS:new();
local entity = ecs:spawn(crystal.Entity);
local component = entity:add_component(crystal.Component);
assert(component:entity() == entity);

This site uses Just the Docs, a documentation theme for Jekyll.