xurfer/src/ext/skeleton/main.lua

48 lines
1,001 B
Lua
Raw Normal View History

2026-06-08 15:54:26 +02:00
local api = ...
local ecs = api.ecs
2026-06-08 15:54:26 +02:00
return {
name = "skeleton",
enabled = true,
init = function()
--api.ext.skeleton.extendECS()
end,
2026-06-08 15:54:26 +02:00
update = function()
local iui = api.iui
local backend = api.backend
local mainWindow = api.mainWindow
end,
load = function() end,
draw = function(pass)
if api.iui.idiom == "vr" then
else
end
end,
-- ECS API docs: https://bakpakin.github.io/tiny-ecs/doc
extendECS = function()
local exampleSystem = ecs.processingSystem({
updatethread = true,
-- drawthread = true
filter = ecs.requireAll('mycomponent'),
onAdd = function(self,obj) print_r(obj) end,
onRemove = function(self,obj) end,
process = function(self,obj) end,
})
ecs.addSystem( api.world, exampleSystem )
-- add example entity object
local obj = { foo = "bar", mycomponent = { a = 1 } }
ecs.add( api.world, obj )
obj.commit() -- notify other systems to update entitycache
2026-06-08 15:54:26 +02:00
end
}