@relu-interactives/spatial-ecs
@relu-interactives/spatial-ecs / components / ScriptEntry
Type Alias: ScriptEntry
ts
type ScriptEntry = {
entityId: number;
className: string;
scriptUrl: string;
enabled: boolean;
executeInEditor?: boolean;
data: Record<string, unknown>;
runtimeState?: "idle" | "loading" | "ready" | "error";
runtimeMessage?: string;
};Defined in: components/ScriptComponent.ts:7
One script attached to an entity. Multiple entries may target a single entity (different classes from the same or different files).
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
entityId | number | Owning entity id. | components/ScriptComponent.ts:9 |
className | string | Class name exported by the script module (default export class name). | components/ScriptComponent.ts:11 |
scriptUrl | string | Compiled script URL (e.g. localasset://.../scripts/foo.js). | components/ScriptComponent.ts:13 |
enabled | boolean | When false, the script is skipped each frame. | components/ScriptComponent.ts:15 |
executeInEditor? | boolean | When true, the script is executed inside the editor (not just at preview/runtime). Enables direct Three.js scene access via this.world.getScene() / getCamera() / getRenderer() for logic the editor's object palette cannot produce (custom shaders, procedural geometry, grass, etc.). Defaults to false. | components/ScriptComponent.ts:22 |
data | Record<string, unknown> | Inspector-bound payload exposed to the script as this.data. | components/ScriptComponent.ts:24 |
runtimeState? | "idle" | "loading" | "ready" | "error" | Last load/runtime status reported by ScriptBehaviourSystem. | components/ScriptComponent.ts:26 |
runtimeMessage? | string | Optional human-readable status message (e.g. compile/load error). | components/ScriptComponent.ts:28 |

