@eva/eva.js 1.2.7-editor.7 → 1.2.8-fix.1
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/dist/EVA.js +191 -394
- package/dist/EVA.min.js +1 -1
- package/dist/eva.js.cjs.js +131 -196
- package/dist/eva.js.cjs.prod.js +2 -2
- package/dist/eva.js.d.ts +8 -18
- package/dist/eva.js.esm.js +131 -197
- package/package.json +2 -3
- package/dist/miniprogram.js +0 -3774
package/dist/eva.js.cjs.js
CHANGED
|
@@ -7,7 +7,7 @@ var lodashEs = require('lodash-es');
|
|
|
7
7
|
var inspectorDecorator = require('@eva/inspector-decorator');
|
|
8
8
|
var resourceLoader$1 = require('resource-loader');
|
|
9
9
|
|
|
10
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e[
|
|
10
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e['default'] : e; }
|
|
11
11
|
|
|
12
12
|
var EventEmitter__default = /*#__PURE__*/_interopDefaultLegacy(EventEmitter);
|
|
13
13
|
|
|
@@ -47,10 +47,6 @@ function __decorate(decorators, target, key, desc) {
|
|
|
47
47
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
function __metadata(metadataKey, metadataValue) {
|
|
51
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
50
|
function __awaiter(thisArg, _arguments, P, generator) {
|
|
55
51
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
56
52
|
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
@@ -374,65 +370,12 @@ function setSystemObserver(system, S) {
|
|
|
374
370
|
systemInstance[S.systemName] = system;
|
|
375
371
|
}
|
|
376
372
|
|
|
377
|
-
var Vector2 = (function () {
|
|
378
|
-
function Vector2() {
|
|
379
|
-
}
|
|
380
|
-
__decorate([
|
|
381
|
-
inspectorDecorator.Field({ step: 0.1, default: 0 }),
|
|
382
|
-
__metadata("design:type", Number)
|
|
383
|
-
], Vector2.prototype, "x", void 0);
|
|
384
|
-
__decorate([
|
|
385
|
-
inspectorDecorator.Field({ step: 0.1, default: 0 }),
|
|
386
|
-
__metadata("design:type", Number)
|
|
387
|
-
], Vector2.prototype, "y", void 0);
|
|
388
|
-
return Vector2;
|
|
389
|
-
}());
|
|
390
|
-
var IntVector2 = (function () {
|
|
391
|
-
function IntVector2() {
|
|
392
|
-
}
|
|
393
|
-
__decorate([
|
|
394
|
-
inspectorDecorator.Field({ step: 1, default: 0 }),
|
|
395
|
-
__metadata("design:type", Number)
|
|
396
|
-
], IntVector2.prototype, "x", void 0);
|
|
397
|
-
__decorate([
|
|
398
|
-
inspectorDecorator.Field({ step: 1, default: 0 }),
|
|
399
|
-
__metadata("design:type", Number)
|
|
400
|
-
], IntVector2.prototype, "y", void 0);
|
|
401
|
-
return IntVector2;
|
|
402
|
-
}());
|
|
403
|
-
var Size2 = (function () {
|
|
404
|
-
function Size2() {
|
|
405
|
-
}
|
|
406
|
-
__decorate([
|
|
407
|
-
inspectorDecorator.Field({ step: 1, default: 0 }),
|
|
408
|
-
__metadata("design:type", Number)
|
|
409
|
-
], Size2.prototype, "width", void 0);
|
|
410
|
-
__decorate([
|
|
411
|
-
inspectorDecorator.Field({ step: 1, default: 0 }),
|
|
412
|
-
__metadata("design:type", Number)
|
|
413
|
-
], Size2.prototype, "height", void 0);
|
|
414
|
-
return Size2;
|
|
415
|
-
}());
|
|
416
|
-
var Scale = (function () {
|
|
417
|
-
function Scale() {
|
|
418
|
-
}
|
|
419
|
-
__decorate([
|
|
420
|
-
inspectorDecorator.Field({ step: 0.1, default: 1 }),
|
|
421
|
-
__metadata("design:type", Number)
|
|
422
|
-
], Scale.prototype, "x", void 0);
|
|
423
|
-
__decorate([
|
|
424
|
-
inspectorDecorator.Field({ step: 0.1, default: 1 }),
|
|
425
|
-
__metadata("design:type", Number)
|
|
426
|
-
], Scale.prototype, "y", void 0);
|
|
427
|
-
return Scale;
|
|
428
|
-
}());
|
|
429
373
|
var Transform = (function (_super) {
|
|
430
374
|
__extends(Transform, _super);
|
|
431
375
|
function Transform() {
|
|
432
376
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
433
377
|
_this.name = 'Transform';
|
|
434
378
|
_this._parent = null;
|
|
435
|
-
_this.childIndex = -1;
|
|
436
379
|
_this.inScene = false;
|
|
437
380
|
_this.children = [];
|
|
438
381
|
_this.position = { x: 0, y: 0 };
|
|
@@ -479,16 +422,15 @@ var Transform = (function (_super) {
|
|
|
479
422
|
configurable: true
|
|
480
423
|
});
|
|
481
424
|
Transform.prototype.addChild = function (child) {
|
|
482
|
-
if (child.parent) {
|
|
425
|
+
if (child.parent === this) {
|
|
426
|
+
var index = this.children.findIndex(function (item) { return item === child; });
|
|
427
|
+
this.children.splice(index, 1);
|
|
428
|
+
}
|
|
429
|
+
else if (child.parent) {
|
|
483
430
|
child.parent.removeChild(child);
|
|
484
431
|
}
|
|
485
432
|
child._parent = this;
|
|
486
|
-
|
|
487
|
-
this.children.splice(child.childIndex, 0, child);
|
|
488
|
-
}
|
|
489
|
-
else {
|
|
490
|
-
this.children.push(child);
|
|
491
|
-
}
|
|
433
|
+
this.children.push(child);
|
|
492
434
|
};
|
|
493
435
|
Transform.prototype.removeChild = function (child) {
|
|
494
436
|
var index = this.children.findIndex(function (item) { return item === child; });
|
|
@@ -502,32 +444,32 @@ var Transform = (function (_super) {
|
|
|
502
444
|
};
|
|
503
445
|
Transform.componentName = 'Transform';
|
|
504
446
|
__decorate([
|
|
505
|
-
inspectorDecorator.
|
|
506
|
-
|
|
447
|
+
inspectorDecorator.type('vector2'),
|
|
448
|
+
inspectorDecorator.step(1)
|
|
507
449
|
], Transform.prototype, "position", void 0);
|
|
508
450
|
__decorate([
|
|
509
|
-
inspectorDecorator.
|
|
510
|
-
|
|
451
|
+
inspectorDecorator.type('size'),
|
|
452
|
+
inspectorDecorator.step(1)
|
|
511
453
|
], Transform.prototype, "size", void 0);
|
|
512
454
|
__decorate([
|
|
513
|
-
inspectorDecorator.
|
|
514
|
-
|
|
455
|
+
inspectorDecorator.type('vector2'),
|
|
456
|
+
inspectorDecorator.step(0.1)
|
|
515
457
|
], Transform.prototype, "origin", void 0);
|
|
516
458
|
__decorate([
|
|
517
|
-
inspectorDecorator.
|
|
518
|
-
|
|
459
|
+
inspectorDecorator.type('vector2'),
|
|
460
|
+
inspectorDecorator.step(0.1)
|
|
519
461
|
], Transform.prototype, "anchor", void 0);
|
|
520
462
|
__decorate([
|
|
521
|
-
inspectorDecorator.
|
|
522
|
-
|
|
463
|
+
inspectorDecorator.type('vector2'),
|
|
464
|
+
inspectorDecorator.step(0.1)
|
|
523
465
|
], Transform.prototype, "scale", void 0);
|
|
524
466
|
__decorate([
|
|
525
|
-
inspectorDecorator.
|
|
526
|
-
|
|
467
|
+
inspectorDecorator.type('vector2'),
|
|
468
|
+
inspectorDecorator.step(0.1)
|
|
527
469
|
], Transform.prototype, "skew", void 0);
|
|
528
470
|
__decorate([
|
|
529
|
-
inspectorDecorator.
|
|
530
|
-
|
|
471
|
+
inspectorDecorator.type('number'),
|
|
472
|
+
inspectorDecorator.step(0.1)
|
|
531
473
|
], Transform.prototype, "rotation", void 0);
|
|
532
474
|
return Transform;
|
|
533
475
|
}(Component$1));
|
|
@@ -614,13 +556,6 @@ var GameObject = (function () {
|
|
|
614
556
|
gameObject.transform.parent = this.transform;
|
|
615
557
|
gameObject.scene = this.scene;
|
|
616
558
|
};
|
|
617
|
-
GameObject.prototype.addChildAt = function (gameObject, index) {
|
|
618
|
-
if (index > this.transform.children.length) {
|
|
619
|
-
throw new Error(gameObject.name + "addChildAt: The index 18 supplied is out of bounds " + this.transform.children.length);
|
|
620
|
-
}
|
|
621
|
-
this.addChild(gameObject);
|
|
622
|
-
gameObject.transform.childIndex = index;
|
|
623
|
-
};
|
|
624
559
|
GameObject.prototype.removeChild = function (gameObject) {
|
|
625
560
|
if (!(gameObject instanceof GameObject) || !gameObject.parent || gameObject.parent !== this) {
|
|
626
561
|
return gameObject;
|
|
@@ -1132,26 +1067,28 @@ var getAllGameObjects = function (game) {
|
|
|
1132
1067
|
}
|
|
1133
1068
|
return __spread(mainSceneGameObjects, otherSceneGameObjects);
|
|
1134
1069
|
};
|
|
1135
|
-
var
|
|
1136
|
-
var e_2, _a, e_3, _b;
|
|
1070
|
+
var gameObjectLoop = function (e, gameObjects) {
|
|
1071
|
+
var e_2, _a, e_3, _b, e_4, _c, e_5, _d;
|
|
1072
|
+
if (gameObjects === void 0) { gameObjects = []; }
|
|
1137
1073
|
try {
|
|
1138
1074
|
for (var gameObjects_1 = __values(gameObjects), gameObjects_1_1 = gameObjects_1.next(); !gameObjects_1_1.done; gameObjects_1_1 = gameObjects_1.next()) {
|
|
1139
1075
|
var gameObject = gameObjects_1_1.value;
|
|
1140
1076
|
try {
|
|
1141
|
-
for (var
|
|
1142
|
-
var component =
|
|
1077
|
+
for (var _e = (e_3 = void 0, __values(gameObject.components)), _f = _e.next(); !_f.done; _f = _e.next()) {
|
|
1078
|
+
var component = _f.value;
|
|
1143
1079
|
try {
|
|
1144
|
-
component
|
|
1080
|
+
triggerStart(component);
|
|
1081
|
+
component.update && component.update(e);
|
|
1145
1082
|
}
|
|
1146
1083
|
catch (e) {
|
|
1147
|
-
console.error("gameObject: " + gameObject.name + "
|
|
1084
|
+
console.error("gameObject: " + gameObject.name + " " + component.name + " update error", e);
|
|
1148
1085
|
}
|
|
1149
1086
|
}
|
|
1150
1087
|
}
|
|
1151
1088
|
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
1152
1089
|
finally {
|
|
1153
1090
|
try {
|
|
1154
|
-
if (
|
|
1091
|
+
if (_f && !_f.done && (_b = _e.return)) _b.call(_e);
|
|
1155
1092
|
}
|
|
1156
1093
|
finally { if (e_3) throw e_3.error; }
|
|
1157
1094
|
}
|
|
@@ -1164,27 +1101,24 @@ var gameObjectResume = function (gameObjects) {
|
|
|
1164
1101
|
}
|
|
1165
1102
|
finally { if (e_2) throw e_2.error; }
|
|
1166
1103
|
}
|
|
1167
|
-
};
|
|
1168
|
-
var gameObjectPause = function (gameObjects) {
|
|
1169
|
-
var e_4, _a, e_5, _b;
|
|
1170
1104
|
try {
|
|
1171
1105
|
for (var gameObjects_2 = __values(gameObjects), gameObjects_2_1 = gameObjects_2.next(); !gameObjects_2_1.done; gameObjects_2_1 = gameObjects_2.next()) {
|
|
1172
1106
|
var gameObject = gameObjects_2_1.value;
|
|
1173
1107
|
try {
|
|
1174
|
-
for (var
|
|
1175
|
-
var component =
|
|
1108
|
+
for (var _g = (e_5 = void 0, __values(gameObject.components)), _h = _g.next(); !_h.done; _h = _g.next()) {
|
|
1109
|
+
var component = _h.value;
|
|
1176
1110
|
try {
|
|
1177
|
-
component.
|
|
1111
|
+
component.lateUpdate && component.lateUpdate(e);
|
|
1178
1112
|
}
|
|
1179
1113
|
catch (e) {
|
|
1180
|
-
console.error("gameObject: " + gameObject.name + "
|
|
1114
|
+
console.error("gameObject: " + gameObject.name + " " + component.name + " lateUpdate error", e);
|
|
1181
1115
|
}
|
|
1182
1116
|
}
|
|
1183
1117
|
}
|
|
1184
1118
|
catch (e_5_1) { e_5 = { error: e_5_1 }; }
|
|
1185
1119
|
finally {
|
|
1186
1120
|
try {
|
|
1187
|
-
if (
|
|
1121
|
+
if (_h && !_h.done && (_d = _g.return)) _d.call(_g);
|
|
1188
1122
|
}
|
|
1189
1123
|
finally { if (e_5) throw e_5.error; }
|
|
1190
1124
|
}
|
|
@@ -1193,23 +1127,87 @@ var gameObjectPause = function (gameObjects) {
|
|
|
1193
1127
|
catch (e_4_1) { e_4 = { error: e_4_1 }; }
|
|
1194
1128
|
finally {
|
|
1195
1129
|
try {
|
|
1196
|
-
if (gameObjects_2_1 && !gameObjects_2_1.done && (
|
|
1130
|
+
if (gameObjects_2_1 && !gameObjects_2_1.done && (_c = gameObjects_2.return)) _c.call(gameObjects_2);
|
|
1197
1131
|
}
|
|
1198
1132
|
finally { if (e_4) throw e_4.error; }
|
|
1199
1133
|
}
|
|
1200
1134
|
};
|
|
1135
|
+
var gameObjectResume = function (gameObjects) {
|
|
1136
|
+
var e_6, _a, e_7, _b;
|
|
1137
|
+
try {
|
|
1138
|
+
for (var gameObjects_3 = __values(gameObjects), gameObjects_3_1 = gameObjects_3.next(); !gameObjects_3_1.done; gameObjects_3_1 = gameObjects_3.next()) {
|
|
1139
|
+
var gameObject = gameObjects_3_1.value;
|
|
1140
|
+
try {
|
|
1141
|
+
for (var _c = (e_7 = void 0, __values(gameObject.components)), _d = _c.next(); !_d.done; _d = _c.next()) {
|
|
1142
|
+
var component = _d.value;
|
|
1143
|
+
try {
|
|
1144
|
+
component.onResume && component.onResume();
|
|
1145
|
+
}
|
|
1146
|
+
catch (e) {
|
|
1147
|
+
console.error("gameObject: " + gameObject.name + ", " + component.name + ", onResume error", e);
|
|
1148
|
+
}
|
|
1149
|
+
}
|
|
1150
|
+
}
|
|
1151
|
+
catch (e_7_1) { e_7 = { error: e_7_1 }; }
|
|
1152
|
+
finally {
|
|
1153
|
+
try {
|
|
1154
|
+
if (_d && !_d.done && (_b = _c.return)) _b.call(_c);
|
|
1155
|
+
}
|
|
1156
|
+
finally { if (e_7) throw e_7.error; }
|
|
1157
|
+
}
|
|
1158
|
+
}
|
|
1159
|
+
}
|
|
1160
|
+
catch (e_6_1) { e_6 = { error: e_6_1 }; }
|
|
1161
|
+
finally {
|
|
1162
|
+
try {
|
|
1163
|
+
if (gameObjects_3_1 && !gameObjects_3_1.done && (_a = gameObjects_3.return)) _a.call(gameObjects_3);
|
|
1164
|
+
}
|
|
1165
|
+
finally { if (e_6) throw e_6.error; }
|
|
1166
|
+
}
|
|
1167
|
+
};
|
|
1168
|
+
var gameObjectPause = function (gameObjects) {
|
|
1169
|
+
var e_8, _a, e_9, _b;
|
|
1170
|
+
try {
|
|
1171
|
+
for (var gameObjects_4 = __values(gameObjects), gameObjects_4_1 = gameObjects_4.next(); !gameObjects_4_1.done; gameObjects_4_1 = gameObjects_4.next()) {
|
|
1172
|
+
var gameObject = gameObjects_4_1.value;
|
|
1173
|
+
try {
|
|
1174
|
+
for (var _c = (e_9 = void 0, __values(gameObject.components)), _d = _c.next(); !_d.done; _d = _c.next()) {
|
|
1175
|
+
var component = _d.value;
|
|
1176
|
+
try {
|
|
1177
|
+
component.onPause && component.onPause();
|
|
1178
|
+
}
|
|
1179
|
+
catch (e) {
|
|
1180
|
+
console.error("gameObject: " + gameObject.name + ", " + component.name + ", onResume error", e);
|
|
1181
|
+
}
|
|
1182
|
+
}
|
|
1183
|
+
}
|
|
1184
|
+
catch (e_9_1) { e_9 = { error: e_9_1 }; }
|
|
1185
|
+
finally {
|
|
1186
|
+
try {
|
|
1187
|
+
if (_d && !_d.done && (_b = _c.return)) _b.call(_c);
|
|
1188
|
+
}
|
|
1189
|
+
finally { if (e_9) throw e_9.error; }
|
|
1190
|
+
}
|
|
1191
|
+
}
|
|
1192
|
+
}
|
|
1193
|
+
catch (e_8_1) { e_8 = { error: e_8_1 }; }
|
|
1194
|
+
finally {
|
|
1195
|
+
try {
|
|
1196
|
+
if (gameObjects_4_1 && !gameObjects_4_1.done && (_a = gameObjects_4.return)) _a.call(gameObjects_4);
|
|
1197
|
+
}
|
|
1198
|
+
finally { if (e_8) throw e_8.error; }
|
|
1199
|
+
}
|
|
1200
|
+
};
|
|
1201
1201
|
var Game = (function (_super) {
|
|
1202
1202
|
__extends(Game, _super);
|
|
1203
1203
|
function Game(_a) {
|
|
1204
|
-
var
|
|
1205
|
-
var _c = _a === void 0 ? {} : _a, systems = _c.systems, _d = _c.frameRate, frameRate = _d === void 0 ? 60 : _d, _e = _c.autoStart, autoStart = _e === void 0 ? true : _e, _f = _c.needScene, needScene = _f === void 0 ? true : _f
|
|
1204
|
+
var e_10, _b;
|
|
1205
|
+
var _c = _a === void 0 ? {} : _a, systems = _c.systems, _d = _c.frameRate, frameRate = _d === void 0 ? 60 : _d, _e = _c.autoStart, autoStart = _e === void 0 ? true : _e, _f = _c.needScene, needScene = _f === void 0 ? true : _f;
|
|
1206
1206
|
var _this = _super.call(this) || this;
|
|
1207
1207
|
_this.playing = false;
|
|
1208
1208
|
_this.started = false;
|
|
1209
1209
|
_this.multiScenes = [];
|
|
1210
1210
|
_this.systems = [];
|
|
1211
|
-
_this.mode = 'PLAY';
|
|
1212
|
-
_this.mode = mode;
|
|
1213
1211
|
if (window.__EVA_INSPECTOR_ENV__) {
|
|
1214
1212
|
window.__EVA_GAME_INSTANCE__ = _this;
|
|
1215
1213
|
}
|
|
@@ -1222,12 +1220,12 @@ var Game = (function (_super) {
|
|
|
1222
1220
|
_this.addSystem(system);
|
|
1223
1221
|
}
|
|
1224
1222
|
}
|
|
1225
|
-
catch (
|
|
1223
|
+
catch (e_10_1) { e_10 = { error: e_10_1 }; }
|
|
1226
1224
|
finally {
|
|
1227
1225
|
try {
|
|
1228
1226
|
if (systems_1_1 && !systems_1_1.done && (_b = systems_1.return)) _b.call(systems_1);
|
|
1229
1227
|
}
|
|
1230
|
-
finally { if (
|
|
1228
|
+
finally { if (e_10) throw e_10.error; }
|
|
1231
1229
|
}
|
|
1232
1230
|
}
|
|
1233
1231
|
if (needScene) {
|
|
@@ -1339,8 +1337,8 @@ var Game = (function (_super) {
|
|
|
1339
1337
|
Game.prototype.initTicker = function () {
|
|
1340
1338
|
var _this = this;
|
|
1341
1339
|
this.ticker.add(function (e) {
|
|
1342
|
-
var
|
|
1343
|
-
_this.scene &&
|
|
1340
|
+
var e_11, _a, e_12, _b;
|
|
1341
|
+
_this.scene && gameObjectLoop(e, _this.gameObjects);
|
|
1344
1342
|
try {
|
|
1345
1343
|
for (var _c = __values(_this.systems), _d = _c.next(); !_d.done; _d = _c.next()) {
|
|
1346
1344
|
var system = _d.value;
|
|
@@ -1353,12 +1351,12 @@ var Game = (function (_super) {
|
|
|
1353
1351
|
}
|
|
1354
1352
|
}
|
|
1355
1353
|
}
|
|
1356
|
-
catch (
|
|
1354
|
+
catch (e_11_1) { e_11 = { error: e_11_1 }; }
|
|
1357
1355
|
finally {
|
|
1358
1356
|
try {
|
|
1359
1357
|
if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
|
|
1360
1358
|
}
|
|
1361
|
-
finally { if (
|
|
1359
|
+
finally { if (e_11) throw e_11.error; }
|
|
1362
1360
|
}
|
|
1363
1361
|
try {
|
|
1364
1362
|
for (var _e = __values(_this.systems), _f = _e.next(); !_f.done; _f = _e.next()) {
|
|
@@ -1371,17 +1369,17 @@ var Game = (function (_super) {
|
|
|
1371
1369
|
}
|
|
1372
1370
|
}
|
|
1373
1371
|
}
|
|
1374
|
-
catch (
|
|
1372
|
+
catch (e_12_1) { e_12 = { error: e_12_1 }; }
|
|
1375
1373
|
finally {
|
|
1376
1374
|
try {
|
|
1377
1375
|
if (_f && !_f.done && (_b = _e.return)) _b.call(_e);
|
|
1378
1376
|
}
|
|
1379
|
-
finally { if (
|
|
1377
|
+
finally { if (e_12) throw e_12.error; }
|
|
1380
1378
|
}
|
|
1381
1379
|
});
|
|
1382
1380
|
};
|
|
1383
1381
|
Game.prototype.triggerResume = function () {
|
|
1384
|
-
var
|
|
1382
|
+
var e_13, _a;
|
|
1385
1383
|
gameObjectResume(this.gameObjects);
|
|
1386
1384
|
try {
|
|
1387
1385
|
for (var _b = __values(this.systems), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
@@ -1394,16 +1392,16 @@ var Game = (function (_super) {
|
|
|
1394
1392
|
}
|
|
1395
1393
|
}
|
|
1396
1394
|
}
|
|
1397
|
-
catch (
|
|
1395
|
+
catch (e_13_1) { e_13 = { error: e_13_1 }; }
|
|
1398
1396
|
finally {
|
|
1399
1397
|
try {
|
|
1400
1398
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
1401
1399
|
}
|
|
1402
|
-
finally { if (
|
|
1400
|
+
finally { if (e_13) throw e_13.error; }
|
|
1403
1401
|
}
|
|
1404
1402
|
};
|
|
1405
1403
|
Game.prototype.triggerPause = function () {
|
|
1406
|
-
var
|
|
1404
|
+
var e_14, _a;
|
|
1407
1405
|
gameObjectPause(this.gameObjects);
|
|
1408
1406
|
try {
|
|
1409
1407
|
for (var _b = __values(this.systems), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
@@ -1416,28 +1414,28 @@ var Game = (function (_super) {
|
|
|
1416
1414
|
}
|
|
1417
1415
|
}
|
|
1418
1416
|
}
|
|
1419
|
-
catch (
|
|
1417
|
+
catch (e_14_1) { e_14 = { error: e_14_1 }; }
|
|
1420
1418
|
finally {
|
|
1421
1419
|
try {
|
|
1422
1420
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
1423
1421
|
}
|
|
1424
|
-
finally { if (
|
|
1422
|
+
finally { if (e_14) throw e_14.error; }
|
|
1425
1423
|
}
|
|
1426
1424
|
};
|
|
1427
1425
|
Game.prototype.destroySystems = function () {
|
|
1428
|
-
var
|
|
1426
|
+
var e_15, _a;
|
|
1429
1427
|
try {
|
|
1430
1428
|
for (var _b = __values(__spread(this.systems)), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
1431
1429
|
var system = _c.value;
|
|
1432
1430
|
this.removeSystem(system);
|
|
1433
1431
|
}
|
|
1434
1432
|
}
|
|
1435
|
-
catch (
|
|
1433
|
+
catch (e_15_1) { e_15 = { error: e_15_1 }; }
|
|
1436
1434
|
finally {
|
|
1437
1435
|
try {
|
|
1438
1436
|
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
1439
1437
|
}
|
|
1440
|
-
finally { if (
|
|
1438
|
+
finally { if (e_15) throw e_15.error; }
|
|
1441
1439
|
}
|
|
1442
1440
|
this.systems.length = 0;
|
|
1443
1441
|
};
|
|
@@ -1466,82 +1464,17 @@ var Game = (function (_super) {
|
|
|
1466
1464
|
}
|
|
1467
1465
|
this.emit('sceneChanged', { scene: scene, mode: mode, params: params });
|
|
1468
1466
|
};
|
|
1469
|
-
Game.prototype.shouldUpdate = function (component) {
|
|
1470
|
-
return this.mode === 'PLAY' || (this.mode === 'EDIT' && inspectorDecorator.shouldExecuteInEditMode(component.constructor));
|
|
1471
|
-
};
|
|
1472
|
-
Game.prototype.gameObjectLoop = function (e, gameObjects) {
|
|
1473
|
-
var e_12, _a, e_13, _b, e_14, _c, e_15, _d;
|
|
1474
|
-
if (gameObjects === void 0) { gameObjects = []; }
|
|
1475
|
-
try {
|
|
1476
|
-
for (var gameObjects_3 = __values(gameObjects), gameObjects_3_1 = gameObjects_3.next(); !gameObjects_3_1.done; gameObjects_3_1 = gameObjects_3.next()) {
|
|
1477
|
-
var gameObject = gameObjects_3_1.value;
|
|
1478
|
-
try {
|
|
1479
|
-
for (var _e = (e_13 = void 0, __values(gameObject.components)), _f = _e.next(); !_f.done; _f = _e.next()) {
|
|
1480
|
-
var component = _f.value;
|
|
1481
|
-
try {
|
|
1482
|
-
if (this.shouldUpdate(component)) {
|
|
1483
|
-
triggerStart(component);
|
|
1484
|
-
component.update && component.update(e);
|
|
1485
|
-
}
|
|
1486
|
-
}
|
|
1487
|
-
catch (e) {
|
|
1488
|
-
console.error("gameObject: " + gameObject.name + " " + component.name + " update error", e);
|
|
1489
|
-
}
|
|
1490
|
-
}
|
|
1491
|
-
}
|
|
1492
|
-
catch (e_13_1) { e_13 = { error: e_13_1 }; }
|
|
1493
|
-
finally {
|
|
1494
|
-
try {
|
|
1495
|
-
if (_f && !_f.done && (_b = _e.return)) _b.call(_e);
|
|
1496
|
-
}
|
|
1497
|
-
finally { if (e_13) throw e_13.error; }
|
|
1498
|
-
}
|
|
1499
|
-
}
|
|
1500
|
-
}
|
|
1501
|
-
catch (e_12_1) { e_12 = { error: e_12_1 }; }
|
|
1502
|
-
finally {
|
|
1503
|
-
try {
|
|
1504
|
-
if (gameObjects_3_1 && !gameObjects_3_1.done && (_a = gameObjects_3.return)) _a.call(gameObjects_3);
|
|
1505
|
-
}
|
|
1506
|
-
finally { if (e_12) throw e_12.error; }
|
|
1507
|
-
}
|
|
1508
|
-
try {
|
|
1509
|
-
for (var gameObjects_4 = __values(gameObjects), gameObjects_4_1 = gameObjects_4.next(); !gameObjects_4_1.done; gameObjects_4_1 = gameObjects_4.next()) {
|
|
1510
|
-
var gameObject = gameObjects_4_1.value;
|
|
1511
|
-
try {
|
|
1512
|
-
for (var _g = (e_15 = void 0, __values(gameObject.components)), _h = _g.next(); !_h.done; _h = _g.next()) {
|
|
1513
|
-
var component = _h.value;
|
|
1514
|
-
try {
|
|
1515
|
-
if (this.shouldUpdate(component)) {
|
|
1516
|
-
component.lateUpdate && component.lateUpdate(e);
|
|
1517
|
-
}
|
|
1518
|
-
}
|
|
1519
|
-
catch (e) {
|
|
1520
|
-
console.error("gameObject: " + gameObject.name + " " + component.name + " lateUpdate error", e);
|
|
1521
|
-
}
|
|
1522
|
-
}
|
|
1523
|
-
}
|
|
1524
|
-
catch (e_15_1) { e_15 = { error: e_15_1 }; }
|
|
1525
|
-
finally {
|
|
1526
|
-
try {
|
|
1527
|
-
if (_h && !_h.done && (_d = _g.return)) _d.call(_g);
|
|
1528
|
-
}
|
|
1529
|
-
finally { if (e_15) throw e_15.error; }
|
|
1530
|
-
}
|
|
1531
|
-
}
|
|
1532
|
-
}
|
|
1533
|
-
catch (e_14_1) { e_14 = { error: e_14_1 }; }
|
|
1534
|
-
finally {
|
|
1535
|
-
try {
|
|
1536
|
-
if (gameObjects_4_1 && !gameObjects_4_1.done && (_c = gameObjects_4.return)) _c.call(gameObjects_4);
|
|
1537
|
-
}
|
|
1538
|
-
finally { if (e_14) throw e_14.error; }
|
|
1539
|
-
}
|
|
1540
|
-
};
|
|
1541
1467
|
return Game;
|
|
1542
1468
|
}(EventEmitter__default));
|
|
1543
1469
|
var Game$1 = Game;
|
|
1544
1470
|
|
|
1471
|
+
function IDEProp(target, propertyKey) {
|
|
1472
|
+
if (!target.constructor.IDEProps) {
|
|
1473
|
+
target.constructor.IDEProps = [];
|
|
1474
|
+
}
|
|
1475
|
+
target.constructor.IDEProps.push(propertyKey);
|
|
1476
|
+
}
|
|
1477
|
+
|
|
1545
1478
|
function componentObserver(observerInfo) {
|
|
1546
1479
|
if (observerInfo === void 0) { observerInfo = {}; }
|
|
1547
1480
|
return function (constructor) {
|
|
@@ -1970,14 +1903,16 @@ var Resource = (function (_super) {
|
|
|
1970
1903
|
var resource = new Resource();
|
|
1971
1904
|
|
|
1972
1905
|
var decorators = {
|
|
1906
|
+
IDEProp: IDEProp,
|
|
1973
1907
|
componentObserver: componentObserver,
|
|
1974
1908
|
};
|
|
1975
|
-
var version = '1.2.
|
|
1909
|
+
var version = '1.2.8';
|
|
1976
1910
|
console.log("Eva.js version: " + version);
|
|
1977
1911
|
|
|
1978
1912
|
exports.Component = Component$1;
|
|
1979
1913
|
exports.Game = Game$1;
|
|
1980
1914
|
exports.GameObject = GameObject$1;
|
|
1915
|
+
exports.IDEProp = IDEProp;
|
|
1981
1916
|
exports.RESOURCE_TYPE_STRATEGY = RESOURCE_TYPE_STRATEGY;
|
|
1982
1917
|
exports.Scene = Scene$1;
|
|
1983
1918
|
exports.System = System$1;
|