@eva/eva.js 1.2.6 → 1.2.7-editor.2

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 CHANGED
@@ -3,6 +3,13 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
3
3
  var _EVA_IIFE_EVA = function (exports) {
4
4
  'use strict';
5
5
 
6
+ function createCommonjsModule(fn) {
7
+ var module = {
8
+ exports: {}
9
+ };
10
+ return fn(module, module.exports), module.exports;
11
+ }
12
+
6
13
  var _extendStatics$ = function extendStatics$1(d, b) {
7
14
  _extendStatics$ = Object.setPrototypeOf || {
8
15
  __proto__: []
@@ -10,7 +17,7 @@ var _EVA_IIFE_EVA = function (exports) {
10
17
  d.__proto__ = b;
11
18
  } || function (d, b) {
12
19
  for (var p in b) {
13
- if (b.hasOwnProperty(p)) d[p] = b[p];
20
+ if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];
14
21
  }
15
22
  };
16
23
 
@@ -18,6 +25,8 @@ var _EVA_IIFE_EVA = function (exports) {
18
25
  };
19
26
 
20
27
  function __extends$1(d, b) {
28
+ if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
29
+
21
30
  _extendStatics$(d, b);
22
31
 
23
32
  function __() {
@@ -27,6 +36,22 @@ var _EVA_IIFE_EVA = function (exports) {
27
36
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
28
37
  }
29
38
 
39
+ var _assign = function __assign() {
40
+ _assign = Object.assign || function __assign(t) {
41
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
42
+ s = arguments[i];
43
+
44
+ for (var p in s) {
45
+ if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
46
+ }
47
+ }
48
+
49
+ return t;
50
+ };
51
+
52
+ return _assign.apply(this, arguments);
53
+ };
54
+
30
55
  function __decorate(decorators, target, key, desc) {
31
56
  var c = arguments.length,
32
57
  r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
@@ -37,6 +62,10 @@ var _EVA_IIFE_EVA = function (exports) {
37
62
  return c > 3 && r && Object.defineProperty(target, key, r), r;
38
63
  }
39
64
 
65
+ function __metadata(metadataKey, metadataValue) {
66
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
67
+ }
68
+
40
69
  function __awaiter(thisArg, _arguments, P, generator) {
41
70
  function adopt(value) {
42
71
  return value instanceof P ? value : new P(function (resolve) {
@@ -232,13 +261,6 @@ var _EVA_IIFE_EVA = function (exports) {
232
261
  return ar;
233
262
  }
234
263
 
235
- function createCommonjsModule(fn) {
236
- var module = {
237
- exports: {}
238
- };
239
- return fn(module, module.exports), module.exports;
240
- }
241
-
242
264
  var eventemitter3 = createCommonjsModule(function (module) {
243
265
  var has = Object.prototype.hasOwnProperty,
244
266
  prefix = '~';
@@ -1801,34 +1823,173 @@ var _EVA_IIFE_EVA = function (exports) {
1801
1823
  systemInstance[S.systemName] = system;
1802
1824
  }
1803
1825
 
1804
- function getIDEPropsPropertyObj(target, propertyKey) {
1805
- if (!target.constructor.IDEProps) {
1806
- target.constructor.IDEProps = {};
1826
+ var SymbolKeysNotSupportedError = function (_super) {
1827
+ __extends$1(SymbolKeysNotSupportedError, _super);
1828
+
1829
+ function SymbolKeysNotSupportedError() {
1830
+ var _newTarget = this.constructor;
1831
+
1832
+ var _this = _super.call(this, 'Symbol keys are not supported yet!') || this;
1833
+
1834
+ Object.setPrototypeOf(_this, _newTarget.prototype);
1835
+ return _this;
1836
+ }
1837
+
1838
+ return SymbolKeysNotSupportedError;
1839
+ }(Error);
1840
+
1841
+ (function (_super) {
1842
+ __extends$1(StaticGetPropertiesIsNotAFunctionError, _super);
1843
+
1844
+ function StaticGetPropertiesIsNotAFunctionError() {
1845
+ var _newTarget = this.constructor;
1846
+
1847
+ var _this = _super.call(this, 'getProperties is not a function!') || this;
1848
+
1849
+ Object.setPrototypeOf(_this, _newTarget.prototype);
1850
+ return _this;
1851
+ }
1852
+
1853
+ return StaticGetPropertiesIsNotAFunctionError;
1854
+ })(Error);
1855
+
1856
+ var IDE_PROPERTY_METADATA = 'IDE_PROPERTY_METADATA';
1857
+
1858
+ function transformBasicType(type) {
1859
+ if (type === String) {
1860
+ return 'string';
1861
+ }
1862
+
1863
+ if (type === Number) {
1864
+ return 'number';
1865
+ }
1866
+
1867
+ if (type === Boolean) {
1868
+ return 'boolean';
1869
+ }
1870
+
1871
+ return 'unknown';
1872
+ }
1873
+
1874
+ function defineTypes(target, key, options, returnTypeFunction) {
1875
+ var type = Reflect.getMetadata('design:type', target, key);
1876
+ var isArray = type === Array;
1877
+ var str = transformBasicType(type);
1878
+
1879
+ if (str !== 'unknown') {
1880
+ type = str;
1807
1881
  }
1808
1882
 
1809
- if (!target.constructor.IDEProps[propertyKey]) {
1810
- target.constructor.IDEProps[propertyKey] = {};
1883
+ if (returnTypeFunction) {
1884
+ var returnType = returnTypeFunction();
1885
+
1886
+ if (Array.isArray(returnType)) {
1887
+ isArray = true;
1888
+ type = returnType[0];
1889
+ } else {
1890
+ type = returnType;
1891
+ }
1811
1892
  }
1812
1893
 
1813
- var propertyObj = target.constructor.IDEProps[propertyKey];
1814
- return propertyObj;
1894
+ var properties = Reflect.getMetadata(IDE_PROPERTY_METADATA, target.constructor) || {};
1895
+ properties[key] = _assign({
1896
+ type: type,
1897
+ isArray: isArray
1898
+ }, options);
1899
+ Reflect.defineMetadata(IDE_PROPERTY_METADATA, properties, target.constructor);
1815
1900
  }
1816
1901
 
1817
- function type(type) {
1818
- return function (target, propertyKey) {
1819
- var prop = getIDEPropsPropertyObj(target, propertyKey);
1820
- prop.key = propertyKey;
1821
- prop.type = type;
1902
+ function getTypeDecoratorParams(returnTypeFuncOrOptions, maybeOptions) {
1903
+ if (typeof returnTypeFuncOrOptions === 'function') {
1904
+ return {
1905
+ returnTypeFunc: returnTypeFuncOrOptions,
1906
+ options: maybeOptions || {}
1907
+ };
1908
+ }
1909
+
1910
+ return {
1911
+ options: returnTypeFuncOrOptions || {}
1822
1912
  };
1823
1913
  }
1824
1914
 
1825
- function step(step) {
1915
+ function Field(returnTypeFunction, maybeOptions) {
1826
1916
  return function (target, propertyKey) {
1827
- var prop = getIDEPropsPropertyObj(target, propertyKey);
1828
- prop.step = step;
1917
+ if (typeof propertyKey === 'symbol') {
1918
+ throw new SymbolKeysNotSupportedError();
1919
+ }
1920
+
1921
+ var _a = getTypeDecoratorParams(returnTypeFunction, maybeOptions),
1922
+ options = _a.options,
1923
+ returnTypeFunc = _a.returnTypeFunc;
1924
+
1925
+ defineTypes(target, propertyKey, options, returnTypeFunc);
1829
1926
  };
1830
1927
  }
1831
1928
 
1929
+ var Vector2 = function () {
1930
+ function Vector2() {}
1931
+
1932
+ __decorate([Field({
1933
+ step: 0.1,
1934
+ default: 0
1935
+ }), __metadata("design:type", Number)], Vector2.prototype, "x", void 0);
1936
+
1937
+ __decorate([Field({
1938
+ step: 0.1,
1939
+ default: 0
1940
+ }), __metadata("design:type", Number)], Vector2.prototype, "y", void 0);
1941
+
1942
+ return Vector2;
1943
+ }();
1944
+
1945
+ var IntVector2 = function () {
1946
+ function IntVector2() {}
1947
+
1948
+ __decorate([Field({
1949
+ step: 1,
1950
+ default: 0
1951
+ }), __metadata("design:type", Number)], IntVector2.prototype, "x", void 0);
1952
+
1953
+ __decorate([Field({
1954
+ step: 1,
1955
+ default: 0
1956
+ }), __metadata("design:type", Number)], IntVector2.prototype, "y", void 0);
1957
+
1958
+ return IntVector2;
1959
+ }();
1960
+
1961
+ var Size2 = function () {
1962
+ function Size2() {}
1963
+
1964
+ __decorate([Field({
1965
+ step: 1,
1966
+ default: 0
1967
+ }), __metadata("design:type", Number)], Size2.prototype, "width", void 0);
1968
+
1969
+ __decorate([Field({
1970
+ step: 1,
1971
+ default: 0
1972
+ }), __metadata("design:type", Number)], Size2.prototype, "height", void 0);
1973
+
1974
+ return Size2;
1975
+ }();
1976
+
1977
+ var Scale = function () {
1978
+ function Scale() {}
1979
+
1980
+ __decorate([Field({
1981
+ step: 0.1,
1982
+ default: 1
1983
+ }), __metadata("design:type", Number)], Scale.prototype, "x", void 0);
1984
+
1985
+ __decorate([Field({
1986
+ step: 0.1,
1987
+ default: 1
1988
+ }), __metadata("design:type", Number)], Scale.prototype, "y", void 0);
1989
+
1990
+ return Scale;
1991
+ }();
1992
+
1832
1993
  var Transform = function (_super) {
1833
1994
  __extends$1(Transform, _super);
1834
1995
 
@@ -1837,6 +1998,7 @@ var _EVA_IIFE_EVA = function (exports) {
1837
1998
 
1838
1999
  _this.name = 'Transform';
1839
2000
  _this._parent = null;
2001
+ _this.childIndex = -1;
1840
2002
  _this.inScene = false;
1841
2003
  _this.children = [];
1842
2004
  _this.position = {
@@ -1913,17 +2075,17 @@ var _EVA_IIFE_EVA = function (exports) {
1913
2075
  });
1914
2076
 
1915
2077
  Transform.prototype.addChild = function (child) {
1916
- if (child.parent === this) {
1917
- var index = this.children.findIndex(function (item) {
1918
- return item === child;
1919
- });
1920
- this.children.splice(index, 1);
1921
- } else if (child.parent) {
2078
+ if (child.parent) {
1922
2079
  child.parent.removeChild(child);
1923
2080
  }
1924
2081
 
1925
2082
  child._parent = this;
1926
- this.children.push(child);
2083
+
2084
+ if (child.childIndex > -1) {
2085
+ this.children.splice(child.childIndex, 0, child);
2086
+ } else {
2087
+ this.children.push(child);
2088
+ }
1927
2089
  };
1928
2090
 
1929
2091
  Transform.prototype.removeChild = function (child) {
@@ -1943,19 +2105,33 @@ var _EVA_IIFE_EVA = function (exports) {
1943
2105
 
1944
2106
  Transform.componentName = 'Transform';
1945
2107
 
1946
- __decorate([type('vector2'), step(1)], Transform.prototype, "position", void 0);
2108
+ __decorate([Field(function () {
2109
+ return IntVector2;
2110
+ }), __metadata("design:type", IntVector2)], Transform.prototype, "position", void 0);
1947
2111
 
1948
- __decorate([type('size'), step(1)], Transform.prototype, "size", void 0);
2112
+ __decorate([Field(function () {
2113
+ return Size2;
2114
+ }), __metadata("design:type", Size2)], Transform.prototype, "size", void 0);
1949
2115
 
1950
- __decorate([type('vector2'), step(0.1)], Transform.prototype, "origin", void 0);
2116
+ __decorate([Field(function () {
2117
+ return Vector2;
2118
+ }), __metadata("design:type", Vector2)], Transform.prototype, "origin", void 0);
1951
2119
 
1952
- __decorate([type('vector2'), step(0.1)], Transform.prototype, "anchor", void 0);
2120
+ __decorate([Field(function () {
2121
+ return Vector2;
2122
+ }), __metadata("design:type", Vector2)], Transform.prototype, "anchor", void 0);
1953
2123
 
1954
- __decorate([type('vector2'), step(0.1)], Transform.prototype, "scale", void 0);
2124
+ __decorate([Field(function () {
2125
+ return Scale;
2126
+ }), __metadata("design:type", Vector2)], Transform.prototype, "scale", void 0);
1955
2127
 
1956
- __decorate([type('vector2'), step(0.1)], Transform.prototype, "skew", void 0);
2128
+ __decorate([Field(function () {
2129
+ return Vector2;
2130
+ }), __metadata("design:type", Vector2)], Transform.prototype, "skew", void 0);
1957
2131
 
1958
- __decorate([type('number'), step(0.1)], Transform.prototype, "rotation", void 0);
2132
+ __decorate([Field({
2133
+ step: 0.1
2134
+ }), __metadata("design:type", Number)], Transform.prototype, "rotation", void 0);
1959
2135
 
1960
2136
  return Transform;
1961
2137
  }(Component$1);
@@ -2053,6 +2229,15 @@ var _EVA_IIFE_EVA = function (exports) {
2053
2229
  gameObject.scene = this.scene;
2054
2230
  };
2055
2231
 
2232
+ GameObject.prototype.addChildAt = function (gameObject, index) {
2233
+ if (index > this.transform.children.length) {
2234
+ throw new Error(gameObject.name + "addChildAt: The index 18 supplied is out of bounds " + this.transform.children.length);
2235
+ }
2236
+
2237
+ this.addChild(gameObject);
2238
+ gameObject.transform.childIndex = index;
2239
+ };
2240
+
2056
2241
  GameObject.prototype.removeChild = function (gameObject) {
2057
2242
  if (!(gameObject instanceof GameObject) || !gameObject.parent || gameObject.parent !== this) {
2058
2243
  return gameObject;
@@ -2689,26 +2874,21 @@ var _EVA_IIFE_EVA = function (exports) {
2689
2874
  return __spread(mainSceneGameObjects, otherSceneGameObjects);
2690
2875
  };
2691
2876
 
2692
- var gameObjectLoop = function gameObjectLoop(e, gameObjects) {
2693
- var e_2, _a, e_3, _b, e_4, _c, e_5, _d;
2694
-
2695
- if (gameObjects === void 0) {
2696
- gameObjects = [];
2697
- }
2877
+ var gameObjectResume = function gameObjectResume(gameObjects) {
2878
+ var e_2, _a, e_3, _b;
2698
2879
 
2699
2880
  try {
2700
2881
  for (var gameObjects_1 = __values(gameObjects), gameObjects_1_1 = gameObjects_1.next(); !gameObjects_1_1.done; gameObjects_1_1 = gameObjects_1.next()) {
2701
2882
  var gameObject = gameObjects_1_1.value;
2702
2883
 
2703
2884
  try {
2704
- for (var _e = (e_3 = void 0, __values(gameObject.components)), _f = _e.next(); !_f.done; _f = _e.next()) {
2705
- var component = _f.value;
2885
+ for (var _c = (e_3 = void 0, __values(gameObject.components)), _d = _c.next(); !_d.done; _d = _c.next()) {
2886
+ var component = _d.value;
2706
2887
 
2707
2888
  try {
2708
- triggerStart(component);
2709
- component.update && component.update(e);
2889
+ component.onResume && component.onResume();
2710
2890
  } catch (e) {
2711
- console.error("gameObject: " + gameObject.name + " " + component.name + " update error", e);
2891
+ console.error("gameObject: " + gameObject.name + ", " + component.name + ", onResume error", e);
2712
2892
  }
2713
2893
  }
2714
2894
  } catch (e_3_1) {
@@ -2717,7 +2897,7 @@ var _EVA_IIFE_EVA = function (exports) {
2717
2897
  };
2718
2898
  } finally {
2719
2899
  try {
2720
- if (_f && !_f.done && (_b = _e.return)) _b.call(_e);
2900
+ if (_d && !_d.done && (_b = _c.return)) _b.call(_c);
2721
2901
  } finally {
2722
2902
  if (e_3) throw e_3.error;
2723
2903
  }
@@ -2734,19 +2914,23 @@ var _EVA_IIFE_EVA = function (exports) {
2734
2914
  if (e_2) throw e_2.error;
2735
2915
  }
2736
2916
  }
2917
+ };
2918
+
2919
+ var gameObjectPause = function gameObjectPause(gameObjects) {
2920
+ var e_4, _a, e_5, _b;
2737
2921
 
2738
2922
  try {
2739
2923
  for (var gameObjects_2 = __values(gameObjects), gameObjects_2_1 = gameObjects_2.next(); !gameObjects_2_1.done; gameObjects_2_1 = gameObjects_2.next()) {
2740
2924
  var gameObject = gameObjects_2_1.value;
2741
2925
 
2742
2926
  try {
2743
- for (var _g = (e_5 = void 0, __values(gameObject.components)), _h = _g.next(); !_h.done; _h = _g.next()) {
2744
- var component = _h.value;
2927
+ for (var _c = (e_5 = void 0, __values(gameObject.components)), _d = _c.next(); !_d.done; _d = _c.next()) {
2928
+ var component = _d.value;
2745
2929
 
2746
2930
  try {
2747
- component.lateUpdate && component.lateUpdate(e);
2931
+ component.onPause && component.onPause();
2748
2932
  } catch (e) {
2749
- console.error("gameObject: " + gameObject.name + " " + component.name + " lateUpdate error", e);
2933
+ console.error("gameObject: " + gameObject.name + ", " + component.name + ", onResume error", e);
2750
2934
  }
2751
2935
  }
2752
2936
  } catch (e_5_1) {
@@ -2755,7 +2939,7 @@ var _EVA_IIFE_EVA = function (exports) {
2755
2939
  };
2756
2940
  } finally {
2757
2941
  try {
2758
- if (_h && !_h.done && (_d = _g.return)) _d.call(_g);
2942
+ if (_d && !_d.done && (_b = _c.return)) _b.call(_c);
2759
2943
  } finally {
2760
2944
  if (e_5) throw e_5.error;
2761
2945
  }
@@ -2767,102 +2951,18 @@ var _EVA_IIFE_EVA = function (exports) {
2767
2951
  };
2768
2952
  } finally {
2769
2953
  try {
2770
- if (gameObjects_2_1 && !gameObjects_2_1.done && (_c = gameObjects_2.return)) _c.call(gameObjects_2);
2954
+ if (gameObjects_2_1 && !gameObjects_2_1.done && (_a = gameObjects_2.return)) _a.call(gameObjects_2);
2771
2955
  } finally {
2772
2956
  if (e_4) throw e_4.error;
2773
2957
  }
2774
2958
  }
2775
2959
  };
2776
2960
 
2777
- var gameObjectResume = function gameObjectResume(gameObjects) {
2778
- var e_6, _a, e_7, _b;
2779
-
2780
- try {
2781
- for (var gameObjects_3 = __values(gameObjects), gameObjects_3_1 = gameObjects_3.next(); !gameObjects_3_1.done; gameObjects_3_1 = gameObjects_3.next()) {
2782
- var gameObject = gameObjects_3_1.value;
2783
-
2784
- try {
2785
- for (var _c = (e_7 = void 0, __values(gameObject.components)), _d = _c.next(); !_d.done; _d = _c.next()) {
2786
- var component = _d.value;
2787
-
2788
- try {
2789
- component.onResume && component.onResume();
2790
- } catch (e) {
2791
- console.error("gameObject: " + gameObject.name + ", " + component.name + ", onResume error", e);
2792
- }
2793
- }
2794
- } catch (e_7_1) {
2795
- e_7 = {
2796
- error: e_7_1
2797
- };
2798
- } finally {
2799
- try {
2800
- if (_d && !_d.done && (_b = _c.return)) _b.call(_c);
2801
- } finally {
2802
- if (e_7) throw e_7.error;
2803
- }
2804
- }
2805
- }
2806
- } catch (e_6_1) {
2807
- e_6 = {
2808
- error: e_6_1
2809
- };
2810
- } finally {
2811
- try {
2812
- if (gameObjects_3_1 && !gameObjects_3_1.done && (_a = gameObjects_3.return)) _a.call(gameObjects_3);
2813
- } finally {
2814
- if (e_6) throw e_6.error;
2815
- }
2816
- }
2817
- };
2818
-
2819
- var gameObjectPause = function gameObjectPause(gameObjects) {
2820
- var e_8, _a, e_9, _b;
2821
-
2822
- try {
2823
- for (var gameObjects_4 = __values(gameObjects), gameObjects_4_1 = gameObjects_4.next(); !gameObjects_4_1.done; gameObjects_4_1 = gameObjects_4.next()) {
2824
- var gameObject = gameObjects_4_1.value;
2825
-
2826
- try {
2827
- for (var _c = (e_9 = void 0, __values(gameObject.components)), _d = _c.next(); !_d.done; _d = _c.next()) {
2828
- var component = _d.value;
2829
-
2830
- try {
2831
- component.onPause && component.onPause();
2832
- } catch (e) {
2833
- console.error("gameObject: " + gameObject.name + ", " + component.name + ", onResume error", e);
2834
- }
2835
- }
2836
- } catch (e_9_1) {
2837
- e_9 = {
2838
- error: e_9_1
2839
- };
2840
- } finally {
2841
- try {
2842
- if (_d && !_d.done && (_b = _c.return)) _b.call(_c);
2843
- } finally {
2844
- if (e_9) throw e_9.error;
2845
- }
2846
- }
2847
- }
2848
- } catch (e_8_1) {
2849
- e_8 = {
2850
- error: e_8_1
2851
- };
2852
- } finally {
2853
- try {
2854
- if (gameObjects_4_1 && !gameObjects_4_1.done && (_a = gameObjects_4.return)) _a.call(gameObjects_4);
2855
- } finally {
2856
- if (e_8) throw e_8.error;
2857
- }
2858
- }
2859
- };
2860
-
2861
2961
  var Game = function (_super) {
2862
2962
  __extends$1(Game, _super);
2863
2963
 
2864
2964
  function Game(_a) {
2865
- var e_10, _b;
2965
+ var e_6, _b;
2866
2966
 
2867
2967
  var _c = _a === void 0 ? {} : _a,
2868
2968
  systems = _c.systems,
@@ -2871,7 +2971,9 @@ var _EVA_IIFE_EVA = function (exports) {
2871
2971
  _e = _c.autoStart,
2872
2972
  autoStart = _e === void 0 ? true : _e,
2873
2973
  _f = _c.needScene,
2874
- needScene = _f === void 0 ? true : _f;
2974
+ needScene = _f === void 0 ? true : _f,
2975
+ _g = _c.mode,
2976
+ mode = _g === void 0 ? 'PLAY' : _g;
2875
2977
 
2876
2978
  var _this = _super.call(this) || this;
2877
2979
 
@@ -2879,6 +2981,8 @@ var _EVA_IIFE_EVA = function (exports) {
2879
2981
  _this.started = false;
2880
2982
  _this.multiScenes = [];
2881
2983
  _this.systems = [];
2984
+ _this.mode = 'PLAY';
2985
+ _this.mode = mode;
2882
2986
 
2883
2987
  if (window.__EVA_INSPECTOR_ENV__) {
2884
2988
  window.__EVA_GAME_INSTANCE__ = _this;
@@ -2898,15 +3002,15 @@ var _EVA_IIFE_EVA = function (exports) {
2898
3002
 
2899
3003
  _this.addSystem(system);
2900
3004
  }
2901
- } catch (e_10_1) {
2902
- e_10 = {
2903
- error: e_10_1
3005
+ } catch (e_6_1) {
3006
+ e_6 = {
3007
+ error: e_6_1
2904
3008
  };
2905
3009
  } finally {
2906
3010
  try {
2907
3011
  if (systems_1_1 && !systems_1_1.done && (_b = systems_1.return)) _b.call(systems_1);
2908
3012
  } finally {
2909
- if (e_10) throw e_10.error;
3013
+ if (e_6) throw e_6.error;
2910
3014
  }
2911
3015
  }
2912
3016
  }
@@ -3035,9 +3139,9 @@ var _EVA_IIFE_EVA = function (exports) {
3035
3139
  var _this = this;
3036
3140
 
3037
3141
  this.ticker.add(function (e) {
3038
- var e_11, _a, e_12, _b;
3142
+ var e_7, _a, e_8, _b;
3039
3143
 
3040
- _this.scene && gameObjectLoop(e, _this.gameObjects);
3144
+ _this.scene && _this.gameObjectLoop(e, _this.gameObjects);
3041
3145
 
3042
3146
  try {
3043
3147
  for (var _c = __values(_this.systems), _d = _c.next(); !_d.done; _d = _c.next()) {
@@ -3050,15 +3154,15 @@ var _EVA_IIFE_EVA = function (exports) {
3050
3154
  console.error(system.constructor.systemName + " update error", e);
3051
3155
  }
3052
3156
  }
3053
- } catch (e_11_1) {
3054
- e_11 = {
3055
- error: e_11_1
3157
+ } catch (e_7_1) {
3158
+ e_7 = {
3159
+ error: e_7_1
3056
3160
  };
3057
3161
  } finally {
3058
3162
  try {
3059
3163
  if (_d && !_d.done && (_a = _c.return)) _a.call(_c);
3060
3164
  } finally {
3061
- if (e_11) throw e_11.error;
3165
+ if (e_7) throw e_7.error;
3062
3166
  }
3063
3167
  }
3064
3168
 
@@ -3072,22 +3176,22 @@ var _EVA_IIFE_EVA = function (exports) {
3072
3176
  console.error(system.constructor.systemName + " lateUpdate error", e);
3073
3177
  }
3074
3178
  }
3075
- } catch (e_12_1) {
3076
- e_12 = {
3077
- error: e_12_1
3179
+ } catch (e_8_1) {
3180
+ e_8 = {
3181
+ error: e_8_1
3078
3182
  };
3079
3183
  } finally {
3080
3184
  try {
3081
3185
  if (_f && !_f.done && (_b = _e.return)) _b.call(_e);
3082
3186
  } finally {
3083
- if (e_12) throw e_12.error;
3187
+ if (e_8) throw e_8.error;
3084
3188
  }
3085
3189
  }
3086
3190
  });
3087
3191
  };
3088
3192
 
3089
3193
  Game.prototype.triggerResume = function () {
3090
- var e_13, _a;
3194
+ var e_9, _a;
3091
3195
 
3092
3196
  gameObjectResume(this.gameObjects);
3093
3197
 
@@ -3101,21 +3205,21 @@ var _EVA_IIFE_EVA = function (exports) {
3101
3205
  console.error(system.constructor.systemName + ", onResume error", e);
3102
3206
  }
3103
3207
  }
3104
- } catch (e_13_1) {
3105
- e_13 = {
3106
- error: e_13_1
3208
+ } catch (e_9_1) {
3209
+ e_9 = {
3210
+ error: e_9_1
3107
3211
  };
3108
3212
  } finally {
3109
3213
  try {
3110
3214
  if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
3111
3215
  } finally {
3112
- if (e_13) throw e_13.error;
3216
+ if (e_9) throw e_9.error;
3113
3217
  }
3114
3218
  }
3115
3219
  };
3116
3220
 
3117
3221
  Game.prototype.triggerPause = function () {
3118
- var e_14, _a;
3222
+ var e_10, _a;
3119
3223
 
3120
3224
  gameObjectPause(this.gameObjects);
3121
3225
 
@@ -3129,36 +3233,36 @@ var _EVA_IIFE_EVA = function (exports) {
3129
3233
  console.error(system.constructor.systemName + ", onPause error", e);
3130
3234
  }
3131
3235
  }
3132
- } catch (e_14_1) {
3133
- e_14 = {
3134
- error: e_14_1
3236
+ } catch (e_10_1) {
3237
+ e_10 = {
3238
+ error: e_10_1
3135
3239
  };
3136
3240
  } finally {
3137
3241
  try {
3138
3242
  if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
3139
3243
  } finally {
3140
- if (e_14) throw e_14.error;
3244
+ if (e_10) throw e_10.error;
3141
3245
  }
3142
3246
  }
3143
3247
  };
3144
3248
 
3145
3249
  Game.prototype.destroySystems = function () {
3146
- var e_15, _a;
3250
+ var e_11, _a;
3147
3251
 
3148
3252
  try {
3149
3253
  for (var _b = __values(__spread(this.systems)), _c = _b.next(); !_c.done; _c = _b.next()) {
3150
3254
  var system = _c.value;
3151
3255
  this.removeSystem(system);
3152
3256
  }
3153
- } catch (e_15_1) {
3154
- e_15 = {
3155
- error: e_15_1
3257
+ } catch (e_11_1) {
3258
+ e_11 = {
3259
+ error: e_11_1
3156
3260
  };
3157
3261
  } finally {
3158
3262
  try {
3159
3263
  if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
3160
3264
  } finally {
3161
- if (e_15) throw e_15.error;
3265
+ if (e_11) throw e_11.error;
3162
3266
  }
3163
3267
  }
3164
3268
 
@@ -3204,19 +3308,100 @@ var _EVA_IIFE_EVA = function (exports) {
3204
3308
  });
3205
3309
  };
3206
3310
 
3311
+ Game.prototype.gameObjectLoop = function (e, gameObjects) {
3312
+ var e_12, _a, e_13, _b, e_14, _c, e_15, _d;
3313
+
3314
+ if (gameObjects === void 0) {
3315
+ gameObjects = [];
3316
+ }
3317
+
3318
+ try {
3319
+ for (var gameObjects_3 = __values(gameObjects), gameObjects_3_1 = gameObjects_3.next(); !gameObjects_3_1.done; gameObjects_3_1 = gameObjects_3.next()) {
3320
+ var gameObject = gameObjects_3_1.value;
3321
+
3322
+ try {
3323
+ for (var _e = (e_13 = void 0, __values(gameObject.components)), _f = _e.next(); !_f.done; _f = _e.next()) {
3324
+ var component = _f.value;
3325
+
3326
+ try {
3327
+ if (this.mode === 'PLAY') {
3328
+ triggerStart(component);
3329
+ component.update && component.update(e);
3330
+ }
3331
+ } catch (e) {
3332
+ console.error("gameObject: " + gameObject.name + " " + component.name + " update error", e);
3333
+ }
3334
+ }
3335
+ } catch (e_13_1) {
3336
+ e_13 = {
3337
+ error: e_13_1
3338
+ };
3339
+ } finally {
3340
+ try {
3341
+ if (_f && !_f.done && (_b = _e.return)) _b.call(_e);
3342
+ } finally {
3343
+ if (e_13) throw e_13.error;
3344
+ }
3345
+ }
3346
+ }
3347
+ } catch (e_12_1) {
3348
+ e_12 = {
3349
+ error: e_12_1
3350
+ };
3351
+ } finally {
3352
+ try {
3353
+ if (gameObjects_3_1 && !gameObjects_3_1.done && (_a = gameObjects_3.return)) _a.call(gameObjects_3);
3354
+ } finally {
3355
+ if (e_12) throw e_12.error;
3356
+ }
3357
+ }
3358
+
3359
+ try {
3360
+ for (var gameObjects_4 = __values(gameObjects), gameObjects_4_1 = gameObjects_4.next(); !gameObjects_4_1.done; gameObjects_4_1 = gameObjects_4.next()) {
3361
+ var gameObject = gameObjects_4_1.value;
3362
+
3363
+ try {
3364
+ for (var _g = (e_15 = void 0, __values(gameObject.components)), _h = _g.next(); !_h.done; _h = _g.next()) {
3365
+ var component = _h.value;
3366
+
3367
+ try {
3368
+ if (this.mode === 'PLAY') {
3369
+ component.lateUpdate && component.lateUpdate(e);
3370
+ }
3371
+ } catch (e) {
3372
+ console.error("gameObject: " + gameObject.name + " " + component.name + " lateUpdate error", e);
3373
+ }
3374
+ }
3375
+ } catch (e_15_1) {
3376
+ e_15 = {
3377
+ error: e_15_1
3378
+ };
3379
+ } finally {
3380
+ try {
3381
+ if (_h && !_h.done && (_d = _g.return)) _d.call(_g);
3382
+ } finally {
3383
+ if (e_15) throw e_15.error;
3384
+ }
3385
+ }
3386
+ }
3387
+ } catch (e_14_1) {
3388
+ e_14 = {
3389
+ error: e_14_1
3390
+ };
3391
+ } finally {
3392
+ try {
3393
+ if (gameObjects_4_1 && !gameObjects_4_1.done && (_c = gameObjects_4.return)) _c.call(gameObjects_4);
3394
+ } finally {
3395
+ if (e_14) throw e_14.error;
3396
+ }
3397
+ }
3398
+ };
3399
+
3207
3400
  return Game;
3208
3401
  }(EE);
3209
3402
 
3210
3403
  var Game$1 = Game;
3211
3404
 
3212
- function IDEProp(target, propertyKey) {
3213
- if (!target.constructor.IDEProps) {
3214
- target.constructor.IDEProps = [];
3215
- }
3216
-
3217
- target.constructor.IDEProps.push(propertyKey);
3218
- }
3219
-
3220
3405
  function componentObserver(observerInfo) {
3221
3406
  if (observerInfo === void 0) {
3222
3407
  observerInfo = {};
@@ -3427,9 +3612,12 @@ var _EVA_IIFE_EVA = function (exports) {
3427
3612
  return Signal;
3428
3613
  }();
3429
3614
 
3430
- function parseURI(str, opts) {
3615
+ var src = function src(str, opts) {
3616
+ if (opts === void 0) {
3617
+ opts = {};
3618
+ }
3619
+
3431
3620
  if (!str) return undefined;
3432
- opts = opts || {};
3433
3621
  var o = {
3434
3622
  key: ['source', 'protocol', 'authority', 'userInfo', 'user', 'password', 'host', 'port', 'relative', 'path', 'directory', 'file', 'query', 'anchor'],
3435
3623
  q: {
@@ -3437,8 +3625,8 @@ var _EVA_IIFE_EVA = function (exports) {
3437
3625
  parser: /(?:^|&)([^&=]*)=?([^&]*)/g
3438
3626
  },
3439
3627
  parser: {
3440
- strict: /^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,
3441
- loose: /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/
3628
+ strict: /^(?:([^:/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:/?#]*)(?::(\d*))?))?((((?:[^?#/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,
3629
+ loose: /^(?:(?![^:@]+:[^:@/]*@)([^:/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#/]*\.[^?#/.]+(?:[?#]|$)))*\/?)?([^?#/]*))(?:\?([^#]*))?(?:#(.*))?)/
3442
3630
  }
3443
3631
  };
3444
3632
  var m = o.parser[opts.strictMode ? 'strict' : 'loose'].exec(str);
@@ -3454,10 +3642,9 @@ var _EVA_IIFE_EVA = function (exports) {
3454
3642
  if ($1) uri[o.q.name][$1] = $2;
3455
3643
  });
3456
3644
  return uri;
3457
- }
3645
+ };
3458
3646
 
3459
- var parseUri = parseURI;
3460
- var parseUri$1 = parseUri;
3647
+ var parseUri = src;
3461
3648
 
3462
3649
  var AbstractLoadStrategy = function () {
3463
3650
  function AbstractLoadStrategy(config) {
@@ -4280,7 +4467,7 @@ var _EVA_IIFE_EVA = function (exports) {
4280
4467
  if (window.origin !== window.location.origin) return 'anonymous';
4281
4468
  if (!Resource._tempAnchor) Resource._tempAnchor = document.createElement('a');
4282
4469
  Resource._tempAnchor.href = url;
4283
- var parsed = parseUri$1(Resource._tempAnchor.href, {
4470
+ var parsed = parseUri(Resource._tempAnchor.href, {
4284
4471
  strictMode: true
4285
4472
  });
4286
4473
  var samePort = !parsed.port && loc.port === '' || parsed.port === loc.port;
@@ -4534,13 +4721,13 @@ var _EVA_IIFE_EVA = function (exports) {
4534
4721
  };
4535
4722
 
4536
4723
  Loader.prototype._prepareUrl = function (url, baseUrl) {
4537
- var parsed = parseUri$1(url, {
4724
+ var parsed = parseUri(url, {
4538
4725
  strictMode: true
4539
4726
  });
4540
4727
 
4541
4728
  this._urlResolvers.forEach(function (resolver) {
4542
4729
  url = resolver(url, parsed);
4543
- parsed = parseUri$1(url, {
4730
+ parsed = parseUri(url, {
4544
4731
  strictMode: true
4545
4732
  });
4546
4733
  });
@@ -5158,15 +5345,13 @@ var _EVA_IIFE_EVA = function (exports) {
5158
5345
 
5159
5346
  var resource = new Resource();
5160
5347
  var decorators = {
5161
- IDEProp: IDEProp,
5162
5348
  componentObserver: componentObserver
5163
5349
  };
5164
- var version = '1.2.6';
5350
+ var version = '1.2.7-editor.2';
5165
5351
  console.log("Eva.js version: " + version);
5166
5352
  exports.Component = Component$1;
5167
5353
  exports.Game = Game$1;
5168
5354
  exports.GameObject = GameObject$1;
5169
- exports.IDEProp = IDEProp;
5170
5355
  exports.RESOURCE_TYPE_STRATEGY = RESOURCE_TYPE_STRATEGY;
5171
5356
  exports.Scene = Scene$1;
5172
5357
  exports.System = System$1;