Class: DataProject
IProject for games authored as data (editor scenes + prefab/asset manifest) instead of an OnInit that builds scenes in code. Scripts reach it through DataProject.Current to switch scenes.
Implements
Constructors
Constructor
ts
new DataProject(manifest, options?): DataProject;Parameters
| Parameter | Type |
|---|---|
manifest | ProjectManifest |
options | DataProjectOptions |
Returns
DataProject
Properties
| Property | Modifier | Type | Default value |
|---|---|---|---|
Current | static | DataProject | null | null |
name | readonly | string | undefined |
version | readonly | string | undefined |
Methods
GetActiveScene()
ts
GetActiveScene(): Scene | null;Returns
Scene | null
Implementation of
GetSceneNames()
ts
GetSceneNames(): string[];Returns
string[]
LoadScene()
ts
LoadScene(nameOrPath): boolean;Swaps the active scene; systems get OnStop/OnStart on the next tick. Accepts either the manifest key ("scenes/Level2.scene.json") or the bare name ("Level2"). Scripts call this from inside system iteration, so the swap is deferred out of the current synchronous pass — clearing a scene mid-ForEach would mutate the sparse set being walked.
Parameters
| Parameter | Type |
|---|---|
nameOrPath | string |
Returns
boolean
LoadSceneAdditive()
ts
LoadSceneAdditive(nameOrPath): Promise<LoadedScene | null>;Adds a scene's entities to the running one (Scene.LoadAdditive). Async to match the editor's Play, which fetches the file; here every scene is already in the manifest.
Parameters
| Parameter | Type |
|---|---|
nameOrPath | string |
Returns
Promise<LoadedScene | null>
OnClose()
ts
OnClose(): void;Returns
void
Implementation of
OnInit()
ts
OnInit(engine): Promise<boolean>;Parameters
| Parameter | Type |
|---|---|
engine | IEngine |
Returns
Promise<boolean>