@wonderlandengine/editor-api 1.2.3-dev.1 → 1.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/data.d.ts +139 -112
- package/dist/data.js +145 -131
- package/dist/index.d.ts +29 -5
- package/dist/index.js +6 -4
- package/dist/native.d.ts +3 -1
- package/dist/ui.d.ts +4 -2
- package/dist/ui.js +3 -1
- package/package.json +2 -2
package/dist/data.js
CHANGED
@@ -1,18 +1,70 @@
|
|
1
|
+
export let data = (global._wl_internalBinding ?? (() => { }))('data');
|
2
|
+
/* Copy over the access functions to the base prototype */
|
3
|
+
let ApiObject = data ? Object.getPrototypeOf(Object.getPrototypeOf(data)) : null;
|
4
|
+
/** Project type */
|
5
|
+
export var ProjectType;
|
6
|
+
(function (ProjectType) {
|
7
|
+
ProjectType["Website"] = "website";
|
8
|
+
ProjectType["Game"] = "game";
|
9
|
+
})(ProjectType || (ProjectType = {}));
|
10
|
+
export function toValue(value) {
|
11
|
+
if (ApiObject.isPrototypeOf(value))
|
12
|
+
return value.toValue();
|
13
|
+
else
|
14
|
+
return value;
|
15
|
+
}
|
16
|
+
export class Access {
|
17
|
+
exists;
|
18
|
+
keys() {
|
19
|
+
return Object.keys(this).filter((k) => this.exists(k));
|
20
|
+
}
|
21
|
+
values() {
|
22
|
+
return Object.keys(this)
|
23
|
+
.filter((k) => this.exists(k))
|
24
|
+
.map((k) => toValue(this[k]));
|
25
|
+
}
|
26
|
+
entries() {
|
27
|
+
return Object.entries(this)
|
28
|
+
.filter(([k, v]) => this.exists(k))
|
29
|
+
.map(([k, v]) => [k, toValue(v)]);
|
30
|
+
}
|
31
|
+
toValue() {
|
32
|
+
return Object.fromEntries(this.entries());
|
33
|
+
}
|
34
|
+
toJSON() {
|
35
|
+
return this.toValue();
|
36
|
+
}
|
37
|
+
[Symbol.iterator]() {
|
38
|
+
return Object.entries(this)[Symbol.iterator]();
|
39
|
+
}
|
40
|
+
}
|
41
|
+
if (ApiObject) {
|
42
|
+
Object.assign(ApiObject, {
|
43
|
+
keys: Access.prototype.keys,
|
44
|
+
values: Access.prototype.values,
|
45
|
+
entries: Access.prototype.entries,
|
46
|
+
toValue: Access.prototype.toValue,
|
47
|
+
toJSON: Access.prototype.toJSON,
|
48
|
+
[Symbol.iterator]: Access.prototype[Symbol.iterator],
|
49
|
+
});
|
50
|
+
}
|
1
51
|
/** Project settings */
|
2
|
-
export class ProjectSettings {
|
52
|
+
export class ProjectSettings extends Access {
|
3
53
|
name = '';
|
54
|
+
description = '';
|
55
|
+
type = ProjectType.Website;
|
4
56
|
customIndexHtml = false;
|
5
57
|
extraFilesFolder = 'static';
|
6
58
|
packageForStreaming = false;
|
7
59
|
version = [1, 2, 0];
|
8
60
|
}
|
9
61
|
/** Sky settings */
|
10
|
-
export class SkySettings {
|
62
|
+
export class SkySettings extends Access {
|
11
63
|
enabled = false;
|
12
64
|
material = null;
|
13
65
|
}
|
14
66
|
/** Bloom settings */
|
15
|
-
export class BloomSettings {
|
67
|
+
export class BloomSettings extends Access {
|
16
68
|
enabled = false;
|
17
69
|
passes = 3;
|
18
70
|
threshold = 1.25;
|
@@ -36,12 +88,12 @@ export var TonemappingMode;
|
|
36
88
|
TonemappingMode["Exponential"] = "exponential";
|
37
89
|
})(TonemappingMode || (TonemappingMode = {}));
|
38
90
|
/** HDR settings */
|
39
|
-
export class HdrSettings {
|
91
|
+
export class HdrSettings extends Access {
|
40
92
|
exposure = 1.0;
|
41
93
|
tonemapping = TonemappingMode.Reinhard;
|
42
94
|
}
|
43
95
|
/** Texture streaming settings */
|
44
|
-
export class TextureStreamingSettings {
|
96
|
+
export class TextureStreamingSettings extends Access {
|
45
97
|
maxCacheSize = 1024;
|
46
98
|
maxUploadPerFrame = 10;
|
47
99
|
}
|
@@ -53,7 +105,7 @@ export var EnvironmentMode;
|
|
53
105
|
EnvironmentMode["SphericalHarmonic2"] = "spherical-harmonic-2";
|
54
106
|
})(EnvironmentMode || (EnvironmentMode = {}));
|
55
107
|
/** Environment settings */
|
56
|
-
export class EnvironmentSettings {
|
108
|
+
export class EnvironmentSettings extends Access {
|
57
109
|
enabled = false;
|
58
110
|
image = null;
|
59
111
|
mode = EnvironmentMode.Disabled;
|
@@ -63,7 +115,7 @@ export class EnvironmentSettings {
|
|
63
115
|
maxSpecularEnvironmentSize = 512;
|
64
116
|
}
|
65
117
|
/** Rendering settings */
|
66
|
-
export class RenderingSettings {
|
118
|
+
export class RenderingSettings extends Access {
|
67
119
|
api = 'webgl2';
|
68
120
|
textureAtlasSize = [8192, 4096];
|
69
121
|
compressedTextureAtlasSize = [16384, 8192];
|
@@ -80,12 +132,12 @@ export class RenderingSettings {
|
|
80
132
|
maxTextures = 1024;
|
81
133
|
}
|
82
134
|
/** Camera settings */
|
83
|
-
export class CameraSettings {
|
135
|
+
export class CameraSettings extends Access {
|
84
136
|
near = 0.02;
|
85
137
|
far = 100.0;
|
86
138
|
}
|
87
139
|
/** Editor settings */
|
88
|
-
export class EditorSettings {
|
140
|
+
export class EditorSettings extends Access {
|
89
141
|
serverPort = 8080;
|
90
142
|
serverCOEP = 'require-corp';
|
91
143
|
camera = new CameraSettings();
|
@@ -96,10 +148,10 @@ export class EditorSettings {
|
|
96
148
|
};
|
97
149
|
}
|
98
150
|
/** Plugins settings */
|
99
|
-
export class PluginsSettings {
|
151
|
+
export class PluginsSettings extends Access {
|
100
152
|
}
|
101
153
|
/** WebXR settings */
|
102
|
-
export class WebXRSettings {
|
154
|
+
export class WebXRSettings extends Access {
|
103
155
|
optionalFeatures = {
|
104
156
|
'local': true,
|
105
157
|
'local-floor': false,
|
@@ -112,7 +164,6 @@ export class WebXRSettings {
|
|
112
164
|
'anchors': false,
|
113
165
|
'occlusion': false,
|
114
166
|
'marker-tracking': false,
|
115
|
-
'extraFeatures': '',
|
116
167
|
};
|
117
168
|
requiredFeatures = {
|
118
169
|
'local': true,
|
@@ -126,11 +177,10 @@ export class WebXRSettings {
|
|
126
177
|
'anchors': false,
|
127
178
|
'occlusion': false,
|
128
179
|
'marker-tracking': false,
|
129
|
-
'extraFeatures': '',
|
130
180
|
};
|
131
181
|
}
|
132
182
|
/** PWA settings */
|
133
|
-
export class PWASettings {
|
183
|
+
export class PWASettings extends Access {
|
134
184
|
enable = false;
|
135
185
|
customServiceWorker = false;
|
136
186
|
customManifest = false;
|
@@ -139,7 +189,7 @@ export class PWASettings {
|
|
139
189
|
appIcon = null;
|
140
190
|
}
|
141
191
|
/** Runtime settings */
|
142
|
-
export class RuntimeSettings {
|
192
|
+
export class RuntimeSettings extends Access {
|
143
193
|
visualizeColliders = false;
|
144
194
|
visualizePhysX = false;
|
145
195
|
visualizeOverdraw = false;
|
@@ -159,7 +209,7 @@ export var BundlingType;
|
|
159
209
|
BundlingType["Npm"] = "npm";
|
160
210
|
})(BundlingType || (BundlingType = {}));
|
161
211
|
/** Scripting settings */
|
162
|
-
export class ScriptingSettings {
|
212
|
+
export class ScriptingSettings extends Access {
|
163
213
|
sourcePaths = [];
|
164
214
|
libraryPaths = [];
|
165
215
|
bundlingType = BundlingType.Esbuild;
|
@@ -169,14 +219,14 @@ export class ScriptingSettings {
|
|
169
219
|
entryPoint = 'js/index.js';
|
170
220
|
}
|
171
221
|
/** VR settings */
|
172
|
-
export class VRSettings {
|
222
|
+
export class VRSettings extends Access {
|
173
223
|
enable = true;
|
174
224
|
rightEyeObject = null;
|
175
225
|
leftEyeObject = null;
|
176
226
|
framebufferScaleFactor = 1.0;
|
177
227
|
}
|
178
228
|
/** Physics settings */
|
179
|
-
export class PhysXSettings {
|
229
|
+
export class PhysXSettings extends Access {
|
180
230
|
enable = false;
|
181
231
|
maxTimestep = 0.05;
|
182
232
|
contactOffset = 0.02;
|
@@ -196,18 +246,18 @@ export class PhysXSettings {
|
|
196
246
|
speedToleranceScale = 10.0;
|
197
247
|
}
|
198
248
|
/** AR settings */
|
199
|
-
export class ARSettings {
|
249
|
+
export class ARSettings extends Access {
|
200
250
|
enable = false;
|
201
251
|
}
|
202
252
|
/** Localization settings */
|
203
|
-
export class LocalizationSettings {
|
253
|
+
export class LocalizationSettings extends Access {
|
204
254
|
enableZipCompression = false;
|
205
255
|
format = 'i18next';
|
206
256
|
languagesFolder = 'languages';
|
207
257
|
defaultLanguage = 'en';
|
208
258
|
}
|
209
259
|
/** Settings for the currently open project */
|
210
|
-
export class Settings {
|
260
|
+
export class Settings extends Access {
|
211
261
|
project = new ProjectSettings();
|
212
262
|
rendering = new RenderingSettings();
|
213
263
|
editor = new EditorSettings();
|
@@ -226,8 +276,16 @@ export var ImageCompressionType;
|
|
226
276
|
ImageCompressionType["ETC1s"] = "etc1s";
|
227
277
|
ImageCompressionType["UASTC"] = "uastc";
|
228
278
|
})(ImageCompressionType || (ImageCompressionType = {}));
|
279
|
+
export class Link extends Access {
|
280
|
+
name = '';
|
281
|
+
file = '';
|
282
|
+
}
|
283
|
+
export class Resource extends Access {
|
284
|
+
name = '';
|
285
|
+
link = null;
|
286
|
+
}
|
229
287
|
/** Image resource */
|
230
|
-
export class ImageResource {
|
288
|
+
export class ImageResource extends Resource {
|
231
289
|
name = 'image';
|
232
290
|
maxSize = [8192, 8192];
|
233
291
|
compression = ImageCompressionType.ETC1s;
|
@@ -237,7 +295,7 @@ export class ImageResource {
|
|
237
295
|
hdr = false;
|
238
296
|
}
|
239
297
|
/** Texture resource */
|
240
|
-
export class TextureResource {
|
298
|
+
export class TextureResource extends Resource {
|
241
299
|
name = 'texture';
|
242
300
|
image = null;
|
243
301
|
type = 1;
|
@@ -259,14 +317,14 @@ export var ShaderType;
|
|
259
317
|
ShaderType["Fullscreen"] = "fullscreen";
|
260
318
|
})(ShaderType || (ShaderType = {}));
|
261
319
|
/** Shader resource */
|
262
|
-
export class ShaderResource {
|
320
|
+
export class ShaderResource extends Resource {
|
263
321
|
name = 'shader';
|
264
322
|
stage = ShaderStage.Fragment;
|
265
323
|
type = ShaderType.Forward;
|
266
324
|
packageUnused = false;
|
267
325
|
}
|
268
326
|
/** Mesh resource */
|
269
|
-
export class MeshResource {
|
327
|
+
export class MeshResource extends Resource {
|
270
328
|
name = 'mesh';
|
271
329
|
simplify = false;
|
272
330
|
simplifyTarget = 0.5;
|
@@ -275,7 +333,7 @@ export class MeshResource {
|
|
275
333
|
hasMorphTargets = false;
|
276
334
|
}
|
277
335
|
/** Material properties for the default Phong pipeline */
|
278
|
-
export class PhongMaterial {
|
336
|
+
export class PhongMaterial extends Access {
|
279
337
|
ambientColor = [0.05, 0.05, 0.05, 1.0];
|
280
338
|
diffuseTexture = null;
|
281
339
|
diffuseColor = [1, 1, 1, 1.0];
|
@@ -291,7 +349,7 @@ export class PhongMaterial {
|
|
291
349
|
alphaMaskTexture = null;
|
292
350
|
}
|
293
351
|
/** Material properties for the default Phong pipeline */
|
294
|
-
export class PhysicalMaterial {
|
352
|
+
export class PhysicalMaterial extends Access {
|
295
353
|
albedoColor = [1.0, 1.0, 1.0, 1.0];
|
296
354
|
emissiveTexture = null;
|
297
355
|
emissiveColor = [0.0, 0.0, 0.0, 1.0];
|
@@ -308,19 +366,19 @@ export class PhysicalMaterial {
|
|
308
366
|
alphaMaskTexture = null;
|
309
367
|
}
|
310
368
|
/** Material properties for the default MeshVisualizer pipeline */
|
311
|
-
export class MeshVisualizerMaterial {
|
369
|
+
export class MeshVisualizerMaterial extends Access {
|
312
370
|
color = [0.5, 0.5, 0.5, 1];
|
313
371
|
wireframeColor = [1, 1, 1, 1];
|
314
372
|
}
|
315
373
|
/** Material properties for the default Flat pipeline */
|
316
|
-
export class FlatMaterial {
|
374
|
+
export class FlatMaterial extends Access {
|
317
375
|
color = [1, 1, 1, 1];
|
318
376
|
flatTexture = null;
|
319
377
|
alphaMaskThreshold = 0.5;
|
320
378
|
alphaMaskTexture = null;
|
321
379
|
}
|
322
380
|
/** Material properties for the default Particle pipeline */
|
323
|
-
export class ParticleMaterial {
|
381
|
+
export class ParticleMaterial extends Access {
|
324
382
|
color = [1, 1, 1, 1];
|
325
383
|
mainTexture = null;
|
326
384
|
noiseTexture = null;
|
@@ -328,7 +386,7 @@ export class ParticleMaterial {
|
|
328
386
|
offsetY = 0.0;
|
329
387
|
}
|
330
388
|
/** Material properties for the default DistanceFieldVector pipeline */
|
331
|
-
export class DistanceFieldVectorMaterial {
|
389
|
+
export class DistanceFieldVectorMaterial extends Access {
|
332
390
|
color = [1, 1, 1, 1];
|
333
391
|
outlineColor = [0, 0, 0, 1];
|
334
392
|
outlineRange = [0.4, 0.3];
|
@@ -336,13 +394,13 @@ export class DistanceFieldVectorMaterial {
|
|
336
394
|
smoothness = 0.02;
|
337
395
|
}
|
338
396
|
/** Material properties for the default Text pipeline */
|
339
|
-
export class TextMaterial {
|
397
|
+
export class TextMaterial extends Access {
|
340
398
|
color = [1, 1, 1, 1];
|
341
399
|
effectColor = [0, 0, 0, 1];
|
342
400
|
font = null;
|
343
401
|
}
|
344
402
|
/** Material properties for the default Sky pipeline */
|
345
|
-
export class SkyMaterial {
|
403
|
+
export class SkyMaterial extends Access {
|
346
404
|
colorStop0 = [1, 1, 1, 1];
|
347
405
|
colorStop1 = [0.55, 0.95, 1, 1];
|
348
406
|
colorStop2 = [0.55, 0.95, 1, 1];
|
@@ -350,7 +408,7 @@ export class SkyMaterial {
|
|
350
408
|
texture = null;
|
351
409
|
}
|
352
410
|
/** Material properties for the default Background pipeline */
|
353
|
-
export class BackgroundMaterial {
|
411
|
+
export class BackgroundMaterial extends Access {
|
354
412
|
colorStop0 = [1, 1, 1, 1];
|
355
413
|
colorStop1 = [0.55, 0.95, 1, 1];
|
356
414
|
colorStop2 = [0.55, 0.95, 1, 1];
|
@@ -358,7 +416,7 @@ export class BackgroundMaterial {
|
|
358
416
|
texture = null;
|
359
417
|
}
|
360
418
|
/** Material properties for the default Particle pipeline */
|
361
|
-
export class MaterialResource {
|
419
|
+
export class MaterialResource extends Resource {
|
362
420
|
pipeline = null;
|
363
421
|
name = 'material';
|
364
422
|
Phong;
|
@@ -384,8 +442,8 @@ export var RootMotionMode;
|
|
384
442
|
RootMotionMode["ApplyToOwner"] = "applyToOwner";
|
385
443
|
RootMotionMode["ScriptEvent"] = "scriptEvent";
|
386
444
|
})(RootMotionMode || (RootMotionMode = {}));
|
387
|
-
/** 'animation' component
|
388
|
-
export class AnimationComponent {
|
445
|
+
/** 'animation' component */
|
446
|
+
export class AnimationComponent extends Access {
|
389
447
|
preview = false;
|
390
448
|
retarget = false;
|
391
449
|
autoplay = false;
|
@@ -408,8 +466,8 @@ export var LightType;
|
|
408
466
|
/** Sun light type */
|
409
467
|
LightType["Sun"] = "sun";
|
410
468
|
})(LightType || (LightType = {}));
|
411
|
-
/** 'light' component
|
412
|
-
export class LightComponent {
|
469
|
+
/** 'light' component */
|
470
|
+
export class LightComponent extends Access {
|
413
471
|
type = LightType.Point;
|
414
472
|
color = [1.0, 1.0, 1.0];
|
415
473
|
intensity = 1;
|
@@ -430,34 +488,34 @@ export var ProjectionType;
|
|
430
488
|
/** Orthographic projection */
|
431
489
|
ProjectionType["Orthographic"] = "orthographic";
|
432
490
|
})(ProjectionType || (ProjectionType = {}));
|
433
|
-
/** 'view' component
|
434
|
-
export class ViewComponent {
|
491
|
+
/** 'view' component */
|
492
|
+
export class ViewComponent extends Access {
|
435
493
|
projectionType = ProjectionType.Perspective;
|
436
494
|
fov = 90;
|
437
495
|
extent = 10;
|
438
496
|
near = 0.01;
|
439
497
|
far = 100;
|
440
498
|
}
|
441
|
-
/**
|
442
|
-
export class
|
499
|
+
/** Sphere physics shape */
|
500
|
+
export class PhysXSphere extends Access {
|
443
501
|
radius = 0.25;
|
444
502
|
}
|
445
|
-
/**
|
446
|
-
export class
|
503
|
+
/** Box physics shape */
|
504
|
+
export class PhysXBox extends Access {
|
447
505
|
extents = [0.25, 0.25, 0.25];
|
448
506
|
}
|
449
|
-
/**
|
450
|
-
export class
|
507
|
+
/** Capsule physics shape */
|
508
|
+
export class PhysXCapsule extends Access {
|
451
509
|
radius = 0.15;
|
452
510
|
halfHeight = 0.25;
|
453
511
|
}
|
454
|
-
/**
|
455
|
-
export class
|
512
|
+
/** Triangle mesh physics shape */
|
513
|
+
export class PhysXTriangleMesh extends Access {
|
456
514
|
mesh = null;
|
457
515
|
scaling = [1, 1, 1];
|
458
516
|
}
|
459
|
-
/**
|
460
|
-
export class
|
517
|
+
/** Convex mesh physics shape */
|
518
|
+
export class PhysXConvexMesh extends Access {
|
461
519
|
mesh = null;
|
462
520
|
scaling = [1, 1, 1];
|
463
521
|
}
|
@@ -470,8 +528,8 @@ export var PhysXShapeType;
|
|
470
528
|
PhysXShapeType["TriangleMesh"] = "triangleMesh";
|
471
529
|
PhysXShapeType["ConvexMesh"] = "convexMesh";
|
472
530
|
})(PhysXShapeType || (PhysXShapeType = {}));
|
473
|
-
/** 'physx' component
|
474
|
-
export class PhysXComponent {
|
531
|
+
/** 'physx' component */
|
532
|
+
export class PhysXComponent extends Access {
|
475
533
|
static = false;
|
476
534
|
kinematic = false;
|
477
535
|
simulate = true;
|
@@ -500,8 +558,8 @@ export class PhysXComponent {
|
|
500
558
|
solverPositionIterations = 4;
|
501
559
|
solverVelocityIterations = 1;
|
502
560
|
}
|
503
|
-
/** 'mesh' component
|
504
|
-
export class MeshComponent {
|
561
|
+
/** 'mesh' component */
|
562
|
+
export class MeshComponent extends Access {
|
505
563
|
material = null;
|
506
564
|
mesh = null;
|
507
565
|
skin = null;
|
@@ -522,8 +580,8 @@ export var TextWrapMode;
|
|
522
580
|
TextWrapMode["Hard"] = "hard";
|
523
581
|
TextWrapMode["Clip"] = "clip";
|
524
582
|
})(TextWrapMode || (TextWrapMode = {}));
|
525
|
-
/** 'text' component
|
526
|
-
export class TextComponent {
|
583
|
+
/** 'text' component */
|
584
|
+
export class TextComponent extends Access {
|
527
585
|
alignment = 'center';
|
528
586
|
verticalAlignment = 'middle';
|
529
587
|
characterSpacing = 0.0;
|
@@ -534,20 +592,20 @@ export class TextComponent {
|
|
534
592
|
wrapMode = TextWrapMode.None;
|
535
593
|
wrapWidth = 0.0;
|
536
594
|
}
|
537
|
-
/**
|
538
|
-
export class
|
595
|
+
/** Sphere collider */
|
596
|
+
export class Sphere extends Access {
|
539
597
|
radius = 1.0;
|
540
598
|
}
|
541
|
-
/**
|
542
|
-
export class
|
599
|
+
/** AxisAlignedBoundingBox collider */
|
600
|
+
export class AABB extends Access {
|
543
601
|
extents = [1.0, 1.0, 1.0];
|
544
602
|
}
|
545
|
-
/**
|
546
|
-
export class
|
603
|
+
/** Box collider */
|
604
|
+
export class Box extends Access {
|
547
605
|
extents = [1.0, 1.0, 1.0];
|
548
606
|
}
|
549
|
-
/** 'collision' component
|
550
|
-
export class CollisionComponent {
|
607
|
+
/** 'collision' component */
|
608
|
+
export class CollisionComponent extends Access {
|
551
609
|
collider = 'sphere';
|
552
610
|
sphere;
|
553
611
|
aabb;
|
@@ -565,21 +623,21 @@ export var InputType;
|
|
565
623
|
InputType["RayLeft"] = "ray left";
|
566
624
|
InputType["RayRight"] = "ray right";
|
567
625
|
})(InputType || (InputType = {}));
|
568
|
-
/** 'input' component
|
569
|
-
export class InputComponent {
|
626
|
+
/** 'input' component */
|
627
|
+
export class InputComponent extends Access {
|
570
628
|
type = InputType.Head;
|
571
629
|
}
|
572
|
-
export class AnimationEvent {
|
630
|
+
export class AnimationEvent extends Access {
|
573
631
|
time = 0.0;
|
574
632
|
name = '';
|
575
633
|
}
|
576
|
-
export class RootMotion {
|
634
|
+
export class RootMotion extends Access {
|
577
635
|
target = null;
|
578
636
|
translationAxis = 0;
|
579
637
|
rotationAxis = 0;
|
580
638
|
}
|
581
639
|
/** Animation resource */
|
582
|
-
export class AnimationResource {
|
640
|
+
export class AnimationResource extends Resource {
|
583
641
|
/** Name of the animation */
|
584
642
|
name = 'animation';
|
585
643
|
/** Whether to compress the animation */
|
@@ -590,31 +648,31 @@ export class AnimationResource {
|
|
590
648
|
events = [];
|
591
649
|
rootMotion;
|
592
650
|
}
|
593
|
-
/** Component
|
594
|
-
export class
|
651
|
+
/** Component */
|
652
|
+
export class ObjectComponent extends Access {
|
595
653
|
/** Component type */
|
596
654
|
type = null;
|
597
655
|
/** Whether the component is active */
|
598
656
|
active = true;
|
599
|
-
/**
|
657
|
+
/** Animation component */
|
600
658
|
animation;
|
601
|
-
/**
|
659
|
+
/** Collision component */
|
602
660
|
collision;
|
603
|
-
/**
|
661
|
+
/** Input component */
|
604
662
|
input;
|
605
|
-
/**
|
663
|
+
/** Light component */
|
606
664
|
light;
|
607
|
-
/**
|
665
|
+
/** Mesh component */
|
608
666
|
mesh;
|
609
|
-
/**
|
667
|
+
/** Physx component */
|
610
668
|
physx;
|
611
|
-
/**
|
669
|
+
/** Text component */
|
612
670
|
text;
|
613
|
-
/**
|
671
|
+
/** View component */
|
614
672
|
view;
|
615
673
|
}
|
616
674
|
/** Object resource */
|
617
|
-
export class ObjectResource {
|
675
|
+
export class ObjectResource extends Resource {
|
618
676
|
/** Name of the object */
|
619
677
|
name = 'object';
|
620
678
|
/** Translation vector */
|
@@ -631,7 +689,7 @@ export class ObjectResource {
|
|
631
689
|
components = [];
|
632
690
|
}
|
633
691
|
/** Skin resource */
|
634
|
-
export class SkinResource {
|
692
|
+
export class SkinResource extends Resource {
|
635
693
|
/** Name of the skin */
|
636
694
|
name = 'skin';
|
637
695
|
/** List of objects that make up the joints of this skin */
|
@@ -682,7 +740,7 @@ export var MeshSorting;
|
|
682
740
|
MeshSorting["MeshIndex"] = "mesh-index";
|
683
741
|
})(MeshSorting || (MeshSorting = {}));
|
684
742
|
/** Pipeline resource */
|
685
|
-
export class PipelineResource {
|
743
|
+
export class PipelineResource extends Resource {
|
686
744
|
name = 'pipeline';
|
687
745
|
doubleSided = false;
|
688
746
|
castShadows = false;
|
@@ -703,7 +761,7 @@ export class PipelineResource {
|
|
703
761
|
depthFunction = DepthFunction.Less;
|
704
762
|
}
|
705
763
|
/** Font resource */
|
706
|
-
export class FontResource {
|
764
|
+
export class FontResource extends Resource {
|
707
765
|
/** Name of the font */
|
708
766
|
name = 'font';
|
709
767
|
/** Which characters need to be renderable with this font */
|
@@ -714,61 +772,17 @@ export class FontResource {
|
|
714
772
|
outlineSize = 0.1;
|
715
773
|
}
|
716
774
|
/** Language resource */
|
717
|
-
export class LanguageResource {
|
775
|
+
export class LanguageResource extends Resource {
|
718
776
|
/** Name of the language */
|
719
777
|
name = 'language';
|
720
778
|
/** Whether this is the default language */
|
721
779
|
isDefault = false;
|
722
780
|
}
|
723
781
|
/** File resource */
|
724
|
-
export class FileResource {
|
782
|
+
export class FileResource extends Resource {
|
725
783
|
fileName = '';
|
726
784
|
importerName = '';
|
727
785
|
importPhysicalAsPhongMaterials = true;
|
728
786
|
}
|
729
|
-
|
730
|
-
* Access to Wonderland Editor's data.
|
731
|
-
*
|
732
|
-
* Hold control and hover any field in Wonderland Editor to see its JSON path.
|
733
|
-
* The path is equivalent to how you find the matching chain of properties.
|
734
|
-
* @example
|
735
|
-
*
|
736
|
-
* ```
|
737
|
-
* /objects/123/components/0/text/text
|
738
|
-
* ```
|
739
|
-
*
|
740
|
-
* Will match the following code:
|
741
|
-
*
|
742
|
-
* ```ts
|
743
|
-
* WL.data.objects[123].components[0].text.text
|
744
|
-
* ```
|
745
|
-
*/
|
746
|
-
export class EditorData {
|
747
|
-
/** Project settings */
|
748
|
-
settings = new Settings();
|
749
|
-
/** List of scene file paths */
|
750
|
-
files = [];
|
751
|
-
/** Animation resources */
|
752
|
-
animations = [];
|
753
|
-
/** Object resources */
|
754
|
-
objects = [];
|
755
|
-
/** Skin resources */
|
756
|
-
skins = [];
|
757
|
-
/** Image resources */
|
758
|
-
images = [];
|
759
|
-
/** Shader resources */
|
760
|
-
shaders = [];
|
761
|
-
/** Mesh resources */
|
762
|
-
meshes = [];
|
763
|
-
/** Texture resources */
|
764
|
-
textures = [];
|
765
|
-
/** Material resources */
|
766
|
-
materials = [];
|
767
|
-
/** Font resources */
|
768
|
-
fonts = [];
|
769
|
-
/** Pipeline resources */
|
770
|
-
pipelines = [];
|
771
|
-
/** Language resources */
|
772
|
-
languages = [];
|
787
|
+
export class ResourceSection {
|
773
788
|
}
|
774
|
-
export let data = (global._wl_internalBinding ?? (() => { }))('data');
|
package/dist/index.d.ts
CHANGED
@@ -4,10 +4,34 @@ export * as tools from './tools.js';
|
|
4
4
|
export * from './project.js';
|
5
5
|
/** Editor plugin */
|
6
6
|
export declare class EditorPlugin {
|
7
|
+
/** Name of the plugin */
|
7
8
|
name: string;
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
9
|
+
/**
|
10
|
+
* Called to let the plugin draw it's ui. See {@link ui}.
|
11
|
+
*/
|
12
|
+
draw?(): void;
|
13
|
+
/**
|
14
|
+
* Called before a project is saved
|
15
|
+
*
|
16
|
+
* @returns `false` to indicate failure to save.
|
17
|
+
*/
|
18
|
+
preProjectSave?(): boolean;
|
19
|
+
/**
|
20
|
+
* Called after a project is loaded
|
21
|
+
*
|
22
|
+
* @returns `false` to indicate failure to load.
|
23
|
+
*/
|
24
|
+
postProjectLoad?: boolean;
|
25
|
+
/**
|
26
|
+
* Called before a project is packaged
|
27
|
+
*
|
28
|
+
* @returns `false` to abort packaging.
|
29
|
+
*/
|
30
|
+
prePackage?(): boolean;
|
31
|
+
/**
|
32
|
+
* Called after a project is packaged
|
33
|
+
*
|
34
|
+
* @returns `false` to abort packaging.
|
35
|
+
*/
|
36
|
+
postPackage?(): boolean;
|
13
37
|
}
|
package/dist/index.js
CHANGED
@@ -6,10 +6,12 @@ export { tools_1 as tools };
|
|
6
6
|
export * from './project.js';
|
7
7
|
/** Editor plugin */
|
8
8
|
export class EditorPlugin {
|
9
|
+
/** Name of the plugin */
|
9
10
|
name = 'Editor Plugin';
|
10
|
-
|
11
|
-
|
11
|
+
/**
|
12
|
+
* Called after a project is loaded
|
13
|
+
*
|
14
|
+
* @returns `false` to indicate failure to load.
|
15
|
+
*/
|
12
16
|
postProjectLoad;
|
13
|
-
prePackage;
|
14
|
-
postPackage;
|
15
17
|
}
|
package/dist/native.d.ts
CHANGED
@@ -17,11 +17,13 @@ interface NativeUiAPI {
|
|
17
17
|
checkbox(label: string, value: boolean): boolean | null;
|
18
18
|
colorEdit4(label: string, value: Float32Array): boolean;
|
19
19
|
dummy(width: number, height: number): void;
|
20
|
-
sameLine(offset
|
20
|
+
sameLine(offset?: number): void;
|
21
21
|
separator(): void;
|
22
|
+
spinner(): void;
|
22
23
|
beginGroup(): void;
|
23
24
|
endGroup(): void;
|
24
25
|
}
|
26
|
+
/** Project paths */
|
25
27
|
export interface Project {
|
26
28
|
/**
|
27
29
|
* Root directory of the project
|