cocos_scaffold_spawner
Generate spawner scripts for Cocos Creator games to automatically instantiate prefabs on timers or player proximity triggers with configurable limits and callbacks.
Instructions
Generate Spawner{Kind}.ts — instantiate @property prefab on a trigger.
"time" — every @property interval s, up to @property maxActive concurrent. Jitters spawn position within @property spawnBoxSize half-extents. Over cap: despawn oldest (destroy + shift queue). "proximity" — spawn when @property player is within @property triggerRadius, respecting @property cooldown seconds and @property maxActive cap.
Both variants parent spawned nodes under this.node.parent
(NOT the spawner itself — inheriting the spawner's transform is
usually wrong) and fire optional @property onSpawn callback post-
addChild so game code can attach health, patrol targets, etc.
Default rel_path: SpawnerTime.ts / SpawnerProximity.ts.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| project_path | Yes | ||
| kind | No | time | |
| rel_path | No |