Spawn node: place assets at runtime into the play copy, Spawner demo behavior

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
rootandClaude Fable 5.1 committed 2026-09-07 16:57:19 +02:00
1 parent c3a533c4e5
commit 91ee2feadd
13 files changed
+219 -37

No files matched your search

+4
View File
@@ -161,6 +161,10 @@ export class BehaviorSystem implements System {
world.log.push(message);
console.log(`[behavior ${entity.name}]`, message);
},
spawn: (assetId, position, parent) => {
const parentEntity = parent ? world.entities.find((e) => e === parent || e.id === parent.id) ?? null : null;
return world.spawn(assetId, position, parentEntity);
},
destroy: (target: EntityHandle) => {
const found = world.entities.find((e) => e === target || e.id === target.id);
if (found) world.remove(found);