2024-08-13 19:06:49 +00:00
|
|
|
--!optimize 2
|
|
|
|
--!native
|
|
|
|
|
|
|
|
local ReplicatedStorage = game:GetService("ReplicatedStorage")
|
|
|
|
local Matter = require(ReplicatedStorage.DevPackages.Matter)
|
|
|
|
local ecr = require(ReplicatedStorage.DevPackages.ecr)
|
|
|
|
local jecs = require(ReplicatedStorage.Lib)
|
|
|
|
local newWorld = Matter.World.new()
|
|
|
|
local ecs = jecs.World.new()
|
|
|
|
|
|
|
|
local A, B = Matter.component(), Matter.component()
|
|
|
|
local C, D = ecs:component(), ecs:component()
|
|
|
|
|
|
|
|
return {
|
|
|
|
ParameterGenerator = function()
|
2024-10-12 20:18:11 +00:00
|
|
|
local matter_entities = {}
|
|
|
|
local jecs_entities = {}
|
|
|
|
local entities = {
|
|
|
|
matter = matter_entities,
|
|
|
|
jecs = jecs_entities,
|
|
|
|
}
|
|
|
|
for i = 1, 1000 do
|
|
|
|
table.insert(matter_entities, newWorld:spawn(A(), B()))
|
|
|
|
local e = ecs:entity()
|
|
|
|
ecs:set(e, C, {})
|
|
|
|
ecs:set(e, D, {})
|
|
|
|
table.insert(jecs_entities, e)
|
|
|
|
end
|
|
|
|
return entities
|
|
|
|
end,
|
2024-08-13 19:06:49 +00:00
|
|
|
|
|
|
|
Functions = {
|
|
|
|
Matter = function(_, entities)
|
2024-10-12 20:18:11 +00:00
|
|
|
for _, entity in entities.matter do
|
|
|
|
newWorld:despawn(entity)
|
|
|
|
end
|
|
|
|
end,
|
2024-08-13 19:06:49 +00:00
|
|
|
|
|
|
|
Jecs = function(_, entities)
|
2024-10-12 20:18:11 +00:00
|
|
|
for _, entity in entities.jecs do
|
2024-08-13 19:06:49 +00:00
|
|
|
ecs:delete(entity)
|
|
|
|
end
|
2024-10-12 20:18:11 +00:00
|
|
|
end,
|
|
|
|
},
|
2024-08-13 19:06:49 +00:00
|
|
|
}
|