mage-engine 3.23.5 → 3.23.7
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/mage.js +110 -46
- package/package.json +1 -1
package/dist/mage.js
CHANGED
|
@@ -54633,7 +54633,7 @@ if (typeof window !== 'undefined') {
|
|
|
54633
54633
|
};
|
|
54634
54634
|
|
|
54635
54635
|
window.hotkeys = hotkeys;
|
|
54636
|
-
}var DEFAULT_OPTIONS = {
|
|
54636
|
+
}var DEFAULT_OPTIONS$1 = {
|
|
54637
54637
|
keyup: true,
|
|
54638
54638
|
keydown: true
|
|
54639
54639
|
};
|
|
@@ -54689,7 +54689,7 @@ var Keyboard = /*#__PURE__*/function (_EventDispatcher) {
|
|
|
54689
54689
|
}
|
|
54690
54690
|
|
|
54691
54691
|
this.combos.push(combo);
|
|
54692
|
-
hotkeys(combo, DEFAULT_OPTIONS, handler);
|
|
54692
|
+
hotkeys(combo, DEFAULT_OPTIONS$1, handler);
|
|
54693
54693
|
}
|
|
54694
54694
|
}
|
|
54695
54695
|
}, {
|
|
@@ -55093,12 +55093,13 @@ var Config$1 = new Config();var Universe = /*#__PURE__*/function () {
|
|
|
55093
55093
|
value: function toJSON() {
|
|
55094
55094
|
var _this4 = this;
|
|
55095
55095
|
|
|
55096
|
+
var parseJSON = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
55096
55097
|
var elements = Object.keys(this.reality).map(function (k) {
|
|
55097
55098
|
return _this4.get(k);
|
|
55098
55099
|
}).filter(function (element) {
|
|
55099
55100
|
return element.serializable && element.isMesh();
|
|
55100
55101
|
}).map(function (element) {
|
|
55101
|
-
return element.toJSON();
|
|
55102
|
+
return element.toJSON(parseJSON);
|
|
55102
55103
|
});
|
|
55103
55104
|
return {
|
|
55104
55105
|
elements: elements
|
|
@@ -56419,12 +56420,13 @@ var Physics$1 = new Physics();var Scene = /*#__PURE__*/function () {
|
|
|
56419
56420
|
}, {
|
|
56420
56421
|
key: "getHierarchy",
|
|
56421
56422
|
value: function getHierarchy() {
|
|
56423
|
+
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
56422
56424
|
return [{
|
|
56423
|
-
element: this.toJSON(),
|
|
56425
|
+
element: this.toJSON(options.parseJSON),
|
|
56424
56426
|
children: [this.getCamera().getHierarchy()].concat(_toConsumableArray(this.elements.filter(function (e) {
|
|
56425
56427
|
return !e.hasParent() && !e.isHelper() && e.isSerializable();
|
|
56426
56428
|
}).map(function (e) {
|
|
56427
|
-
return e.getHierarchy();
|
|
56429
|
+
return e.getHierarchy(options);
|
|
56428
56430
|
})))
|
|
56429
56431
|
}];
|
|
56430
56432
|
}
|
|
@@ -56655,6 +56657,10 @@ var MOUSE_UP = "mouseUp";
|
|
|
56655
56657
|
var MOUSE_MOVE = "mouseMove";
|
|
56656
56658
|
var ELEMENT_CLICK = "elementClick";
|
|
56657
56659
|
var ELEMENT_DESELECT = "elementDeselect";
|
|
56660
|
+
var DEFAULT_OPTIONS = {
|
|
56661
|
+
recursiveSearch: false,
|
|
56662
|
+
selectTags: [DEFAULT_TAG]
|
|
56663
|
+
};
|
|
56658
56664
|
|
|
56659
56665
|
var Mouse = /*#__PURE__*/function (_EventDispatcher) {
|
|
56660
56666
|
_inherits(Mouse, _EventDispatcher);
|
|
@@ -56714,28 +56720,28 @@ var Mouse = /*#__PURE__*/function (_EventDispatcher) {
|
|
|
56714
56720
|
return !!element;
|
|
56715
56721
|
});
|
|
56716
56722
|
|
|
56717
|
-
_defineProperty$1(_assertThisInitialized(_this), "
|
|
56723
|
+
_defineProperty$1(_assertThisInitialized(_this), "filterByTags", function (tags) {
|
|
56718
56724
|
return function (_ref3) {
|
|
56719
56725
|
var element = _ref3.element;
|
|
56720
|
-
return
|
|
56726
|
+
return tags.some(function (tag) {
|
|
56727
|
+
return element.hasTag(tag);
|
|
56728
|
+
});
|
|
56721
56729
|
};
|
|
56722
56730
|
});
|
|
56723
56731
|
|
|
56724
56732
|
_defineProperty$1(_assertThisInitialized(_this), "getIntersections", function () {
|
|
56725
|
-
var recursive = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] :
|
|
56726
|
-
var
|
|
56733
|
+
var recursive = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _this.options.recursiveSearch;
|
|
56734
|
+
var tags = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _this.options.selectTags;
|
|
56727
56735
|
|
|
56728
56736
|
if (_this.hasRaycaster()) {
|
|
56729
56737
|
_this.raycaster.setFromCamera(_this.mouse, Scene$1.getCameraBody());
|
|
56730
56738
|
|
|
56731
|
-
return _this.raycaster.intersectObjects(Scene$1.getChildren(), recursive)
|
|
56732
|
-
.map(_this.parseIntersection).filter(_this.elementExists).filter(_this.elementHasTag(tag));
|
|
56739
|
+
return _this.raycaster.intersectObjects(Scene$1.getChildren(), recursive).map(_this.parseIntersection).filter(_this.elementExists).filter(_this.filterByTags(tags));
|
|
56733
56740
|
}
|
|
56734
56741
|
});
|
|
56735
56742
|
|
|
56736
56743
|
_defineProperty$1(_assertThisInitialized(_this), "onMouseDown", function (event) {
|
|
56737
56744
|
if (!_this.enabled) return;
|
|
56738
|
-
console.log("on mouse down");
|
|
56739
56745
|
event.preventDefault();
|
|
56740
56746
|
|
|
56741
56747
|
var mouseEvent = _this.parseMouseEvent(event);
|
|
@@ -56747,7 +56753,6 @@ var Mouse = /*#__PURE__*/function (_EventDispatcher) {
|
|
|
56747
56753
|
|
|
56748
56754
|
var elements = _this.getIntersections();
|
|
56749
56755
|
|
|
56750
|
-
console.log("clicked elements", elements);
|
|
56751
56756
|
_this.elementClickEvent.elements = elements;
|
|
56752
56757
|
|
|
56753
56758
|
if (!elements.length) {
|
|
@@ -56760,6 +56765,7 @@ var Mouse = /*#__PURE__*/function (_EventDispatcher) {
|
|
|
56760
56765
|
_this.enabled = false;
|
|
56761
56766
|
_this.mouseMoveIntersectionEnabled = false;
|
|
56762
56767
|
_this.mouse = new Vector2();
|
|
56768
|
+
_this.options = DEFAULT_OPTIONS;
|
|
56763
56769
|
_this.mouseDownEvent = {
|
|
56764
56770
|
type: MOUSE_DOWN
|
|
56765
56771
|
};
|
|
@@ -56794,7 +56800,9 @@ var Mouse = /*#__PURE__*/function (_EventDispatcher) {
|
|
|
56794
56800
|
}, {
|
|
56795
56801
|
key: "enable",
|
|
56796
56802
|
value: function enable() {
|
|
56803
|
+
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
56797
56804
|
this.enabled = true;
|
|
56805
|
+
this.options = _objectSpread2$1(_objectSpread2$1({}, DEFAULT_OPTIONS), options);
|
|
56798
56806
|
this.createRayCaster();
|
|
56799
56807
|
Scene$1.getDOMElement().addEventListener("mousemove", this.onMouseMove);
|
|
56800
56808
|
Scene$1.getDOMElement().addEventListener("mousedown", this.onMouseDown);
|
|
@@ -56810,6 +56818,7 @@ var Mouse = /*#__PURE__*/function (_EventDispatcher) {
|
|
|
56810
56818
|
value: function disable() {
|
|
56811
56819
|
this.enabled = false;
|
|
56812
56820
|
this.mouseMoveIntersectionEnabled = false;
|
|
56821
|
+
this.options = DEFAULT_OPTIONS;
|
|
56813
56822
|
document.removeEventListener("mouseup", this.onMouseUp);
|
|
56814
56823
|
Scene$1.getDOMElement().removeEventListener("mousemove", this.onMouseMove);
|
|
56815
56824
|
Scene$1.getDOMElement().removeEventListener("mousedown", this.onMouseDown);
|
|
@@ -57777,7 +57786,7 @@ function applyMiddleware() {
|
|
|
57777
57786
|
|
|
57778
57787
|
var thunk = createThunkMiddleware();
|
|
57779
57788
|
thunk.withExtraArgument = createThunkMiddleware;var name$1 = "mage-engine";
|
|
57780
|
-
var version$1 = "3.23.
|
|
57789
|
+
var version$1 = "3.23.7";
|
|
57781
57790
|
var description = "A WebGL Javascript Game Engine, built on top of THREE.js and many other libraries.";
|
|
57782
57791
|
var main = "dist/mage.js";
|
|
57783
57792
|
var author$1 = {
|
|
@@ -58401,6 +58410,7 @@ var INPUT_EVENTS = (_INPUT_EVENTS = {
|
|
|
58401
58410
|
MOUSE_DOWN: MOUSE_DOWN,
|
|
58402
58411
|
MOUSE_UP: MOUSE_UP
|
|
58403
58412
|
}, _defineProperty$1(_INPUT_EVENTS, "MOUSE_DOWN", MOUSE_DOWN), _defineProperty$1(_INPUT_EVENTS, "MOUSE_MOVE", MOUSE_MOVE), _defineProperty$1(_INPUT_EVENTS, "ELEMENT_CLICK", ELEMENT_CLICK), _defineProperty$1(_INPUT_EVENTS, "ELEMENT_DESELECT", ELEMENT_DESELECT), _defineProperty$1(_INPUT_EVENTS, "GAMEPAD_CONNECTED_EVENT", GAMEPAD_CONNECTED_EVENT), _defineProperty$1(_INPUT_EVENTS, "GAMEPAD_DISCONNECTED_EVENT", GAMEPAD_DISCONNECTED_EVENT), _defineProperty$1(_INPUT_EVENTS, "BUTTON_PRESSED_EVENT", BUTTON_PRESSED_EVENT), _defineProperty$1(_INPUT_EVENTS, "BUTTON_RELEASED_EVENT", BUTTON_RELEASED_EVENT), _defineProperty$1(_INPUT_EVENTS, "AXIS_CHANGE_EVENT", AXIS_CHANGE_EVENT), _INPUT_EVENTS);
|
|
58413
|
+
var DEFAULT_ENABLE_OPTIONS = {};
|
|
58404
58414
|
var Input = /*#__PURE__*/function (_EventDispatcher) {
|
|
58405
58415
|
_inherits(Input, _EventDispatcher);
|
|
58406
58416
|
|
|
@@ -58427,11 +58437,13 @@ var Input = /*#__PURE__*/function (_EventDispatcher) {
|
|
|
58427
58437
|
_createClass(Input, [{
|
|
58428
58438
|
key: "enable",
|
|
58429
58439
|
value: function enable() {
|
|
58440
|
+
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : DEFAULT_ENABLE_OPTIONS;
|
|
58441
|
+
|
|
58430
58442
|
if (!this.enabled) {
|
|
58431
58443
|
dispatch$8(inputEnabled());
|
|
58432
|
-
this.enableGamepad();
|
|
58433
|
-
this.enableKeyboard();
|
|
58434
|
-
this.enableMouse();
|
|
58444
|
+
this.enableGamepad(options.gamepad);
|
|
58445
|
+
this.enableKeyboard(options.keyboard);
|
|
58446
|
+
this.enableMouse(options.mouse);
|
|
58435
58447
|
this.enabled = true;
|
|
58436
58448
|
}
|
|
58437
58449
|
}
|
|
@@ -58454,8 +58466,9 @@ var Input = /*#__PURE__*/function (_EventDispatcher) {
|
|
|
58454
58466
|
}, {
|
|
58455
58467
|
key: "enableGamepad",
|
|
58456
58468
|
value: function enableGamepad() {
|
|
58469
|
+
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
58457
58470
|
dispatch$8(gamepadEnabled());
|
|
58458
|
-
this.gamepad.enable();
|
|
58471
|
+
this.gamepad.enable(options);
|
|
58459
58472
|
this.gamepad.addEventListener(GAMEPAD_CONNECTED_EVENT, this.propagate.bind(this));
|
|
58460
58473
|
this.gamepad.addEventListener(GAMEPAD_DISCONNECTED_EVENT, this.propagate.bind(this));
|
|
58461
58474
|
this.gamepad.addEventListener(BUTTON_RELEASED_EVENT, this.propagate.bind(this));
|
|
@@ -58466,16 +58479,18 @@ var Input = /*#__PURE__*/function (_EventDispatcher) {
|
|
|
58466
58479
|
}, {
|
|
58467
58480
|
key: "enableKeyboard",
|
|
58468
58481
|
value: function enableKeyboard() {
|
|
58482
|
+
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
58469
58483
|
dispatch$8(keyboardEnabled());
|
|
58470
|
-
this.keyboard.enable();
|
|
58484
|
+
this.keyboard.enable(options);
|
|
58471
58485
|
this.keyboard.addEventListener(KEY_DOWN, this.propagate.bind(this));
|
|
58472
58486
|
this.keyboard.addEventListener(KEY_UP, this.propagate.bind(this));
|
|
58473
58487
|
}
|
|
58474
58488
|
}, {
|
|
58475
58489
|
key: "enableMouse",
|
|
58476
58490
|
value: function enableMouse() {
|
|
58491
|
+
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
58477
58492
|
dispatch$8(mouseEnabled());
|
|
58478
|
-
this.mouse.enable();
|
|
58493
|
+
this.mouse.enable(options);
|
|
58479
58494
|
this.mouse.addEventListener(MOUSE_DOWN, this.propagate.bind(this));
|
|
58480
58495
|
this.mouse.addEventListener(MOUSE_UP, this.propagate.bind(this));
|
|
58481
58496
|
this.mouse.addEventListener(MOUSE_MOVE, this.propagate.bind(this));
|
|
@@ -59802,9 +59817,10 @@ var CascadeShadowMaps = /*#__PURE__*/function () {
|
|
|
59802
59817
|
}, {
|
|
59803
59818
|
key: "toJSON",
|
|
59804
59819
|
value: function toJSON() {
|
|
59820
|
+
var parseJSON = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
59805
59821
|
return {
|
|
59806
59822
|
lights: this.lights.map(function (l) {
|
|
59807
|
-
return l.toJSON();
|
|
59823
|
+
return l.toJSON(parseJSON);
|
|
59808
59824
|
})
|
|
59809
59825
|
};
|
|
59810
59826
|
}
|
|
@@ -60007,6 +60023,21 @@ var prepareModel = function prepareModel(model) {
|
|
|
60007
60023
|
setUpLightsAndShadows(mesh);
|
|
60008
60024
|
});
|
|
60009
60025
|
return model;
|
|
60026
|
+
};
|
|
60027
|
+
var serializeVector = function serializeVector(vector) {
|
|
60028
|
+
return {
|
|
60029
|
+
x: vector.x,
|
|
60030
|
+
y: vector.y,
|
|
60031
|
+
z: vector.z
|
|
60032
|
+
};
|
|
60033
|
+
};
|
|
60034
|
+
var serializeQuaternion = function serializeQuaternion(quaternion) {
|
|
60035
|
+
return {
|
|
60036
|
+
x: quaternion.x,
|
|
60037
|
+
y: quaternion.y,
|
|
60038
|
+
z: quaternion.z,
|
|
60039
|
+
w: quaternion.w
|
|
60040
|
+
};
|
|
60010
60041
|
};var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
60011
60042
|
|
|
60012
60043
|
function getAugmentedNamespace(n) {
|
|
@@ -60370,10 +60401,13 @@ var tweenTo = function tweenTo(origin, target) {
|
|
|
60370
60401
|
}, {
|
|
60371
60402
|
key: "getHierarchy",
|
|
60372
60403
|
value: function getHierarchy() {
|
|
60404
|
+
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
60405
|
+
var _options$parseJSON = options.parseJSON,
|
|
60406
|
+
parseJSON = _options$parseJSON === void 0 ? false : _options$parseJSON;
|
|
60373
60407
|
return {
|
|
60374
|
-
element: this.toJSON(),
|
|
60408
|
+
element: this.toJSON(parseJSON),
|
|
60375
60409
|
children: this.children.map(function (e) {
|
|
60376
|
-
return e.getHierarchy();
|
|
60410
|
+
return e.getHierarchy(options);
|
|
60377
60411
|
})
|
|
60378
60412
|
};
|
|
60379
60413
|
}
|
|
@@ -60944,13 +60978,29 @@ var tweenTo = function tweenTo(origin, target) {
|
|
|
60944
60978
|
}, {
|
|
60945
60979
|
key: "toJSON",
|
|
60946
60980
|
value: function toJSON() {
|
|
60981
|
+
var parseJSON = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
60982
|
+
|
|
60947
60983
|
if (this.isSerializable()) {
|
|
60984
|
+
var position = this.getPosition();
|
|
60985
|
+
var rotation = this.getRotation();
|
|
60986
|
+
var scale = this.getScale();
|
|
60987
|
+
var quaternion = this.getQuaternion();
|
|
60988
|
+
|
|
60989
|
+
var _this$getWorldTransfo = this.getWorldTransform(),
|
|
60990
|
+
worldPosition = _this$getWorldTransfo.position,
|
|
60991
|
+
worldRotation = _this$getWorldTransfo.rotation,
|
|
60992
|
+
worldQuaternion = _this$getWorldTransfo.quaternion;
|
|
60993
|
+
|
|
60948
60994
|
return {
|
|
60949
|
-
position:
|
|
60950
|
-
rotation:
|
|
60951
|
-
quaternion:
|
|
60952
|
-
|
|
60953
|
-
|
|
60995
|
+
position: parseJSON ? serializeVector(position) : position,
|
|
60996
|
+
rotation: parseJSON ? serializeVector(rotation) : rotation,
|
|
60997
|
+
quaternion: parseJSON ? serializeQuaternion(quaternion) : quaternion,
|
|
60998
|
+
scale: parseJSON ? serializeVector(scale) : scale,
|
|
60999
|
+
worldTransform: {
|
|
61000
|
+
position: parseJSON ? serializeVector(worldPosition) : worldPosition,
|
|
61001
|
+
rotation: parseJSON ? serializeVector(worldRotation) : worldRotation,
|
|
61002
|
+
quaternion: parseJSON ? serializeQuaternion(worldQuaternion) : worldQuaternion
|
|
61003
|
+
},
|
|
60954
61004
|
entityType: this.getEntityType(),
|
|
60955
61005
|
scripts: this.mapScriptsToJSON(),
|
|
60956
61006
|
tags: this.getTags(),
|
|
@@ -61835,8 +61885,10 @@ var Element$1 = /*#__PURE__*/function (_Entity) {
|
|
|
61835
61885
|
}, {
|
|
61836
61886
|
key: "toJSON",
|
|
61837
61887
|
value: function toJSON() {
|
|
61888
|
+
var parseJSON = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
61889
|
+
|
|
61838
61890
|
if (this.isSerializable()) {
|
|
61839
|
-
return _objectSpread2$1(_objectSpread2$1({}, _get(_getPrototypeOf(Element.prototype), "toJSON", this).call(this)), {}, {
|
|
61891
|
+
return _objectSpread2$1(_objectSpread2$1({}, _get(_getPrototypeOf(Element.prototype), "toJSON", this).call(this, parseJSON)), {}, {
|
|
61840
61892
|
physics: {
|
|
61841
61893
|
state: this.getPhysicsState(),
|
|
61842
61894
|
options: this.getPhysicsOptions()
|
|
@@ -89588,16 +89640,17 @@ var Level = /*#__PURE__*/function (_EventDispatcher) {
|
|
|
89588
89640
|
}, {
|
|
89589
89641
|
key: "toJSON",
|
|
89590
89642
|
value: function toJSON() {
|
|
89591
|
-
|
|
89643
|
+
var parseJSON = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
89644
|
+
return _objectSpread2$1(_objectSpread2$1({}, Lights$1.toJSON(parseJSON)), Universe$1.toJSON(parseJSON));
|
|
89592
89645
|
}
|
|
89593
89646
|
}]);
|
|
89594
89647
|
|
|
89595
89648
|
return Level;
|
|
89596
|
-
}(EventDispatcher);var index=/*#__PURE__*/Object.freeze({__proto__:null,getState:getState,createStore:createStore,dispatch:dispatch$8});var CURRENT_SCENE_NAME =
|
|
89597
|
-
var STATE_SNAPSHOT =
|
|
89598
|
-
var TIMESTAMP =
|
|
89599
|
-
var CURRENT_SCENE_JSON =
|
|
89600
|
-
var CURRENT_PATH =
|
|
89649
|
+
}(EventDispatcher);var index=/*#__PURE__*/Object.freeze({__proto__:null,getState:getState,createStore:createStore,dispatch:dispatch$8});var CURRENT_SCENE_NAME = "CURRENT_SCENE_NAME";
|
|
89650
|
+
var STATE_SNAPSHOT = "STATE_SNAPSHOT";
|
|
89651
|
+
var TIMESTAMP = "TIMESTAMP";
|
|
89652
|
+
var CURRENT_SCENE_JSON = "CURRENT_SCENE_JSON";
|
|
89653
|
+
var CURRENT_PATH = "CURRENT_PATH";
|
|
89601
89654
|
var Storage = /*#__PURE__*/function () {
|
|
89602
89655
|
function Storage() {
|
|
89603
89656
|
_classCallCheck(this, Storage);
|
|
@@ -89606,13 +89659,17 @@ var Storage = /*#__PURE__*/function () {
|
|
|
89606
89659
|
_createClass(Storage, [{
|
|
89607
89660
|
key: "save",
|
|
89608
89661
|
value: function save() {
|
|
89662
|
+
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
89663
|
+
|
|
89609
89664
|
if (Storage.isLocalStorageAvailable()) {
|
|
89610
89665
|
try {
|
|
89611
89666
|
var state = getState();
|
|
89612
89667
|
var timestamp = +new Date();
|
|
89613
89668
|
var currentScene = GameRunner$1.getCurrentLevel();
|
|
89614
89669
|
var currentPath = GameRunner$1.getCurrentPath();
|
|
89615
|
-
var
|
|
89670
|
+
var _options$parseJSON = options.parseJSON,
|
|
89671
|
+
parseJSON = _options$parseJSON === void 0 ? false : _options$parseJSON;
|
|
89672
|
+
var sceneJSON = currentScene.toJSON(parseJSON);
|
|
89616
89673
|
var sceneName = currentScene.name;
|
|
89617
89674
|
localStorage.setItem(TIMESTAMP, timestamp);
|
|
89618
89675
|
localStorage.setItem(CURRENT_SCENE_NAME, sceneName);
|
|
@@ -89673,7 +89730,7 @@ var Storage = /*#__PURE__*/function () {
|
|
|
89673
89730
|
}], [{
|
|
89674
89731
|
key: "isLocalStorageAvailable",
|
|
89675
89732
|
value: function isLocalStorageAvailable() {
|
|
89676
|
-
return window && window.localStorage && typeof window.localStorage.setItem ===
|
|
89733
|
+
return window && window.localStorage && typeof window.localStorage.setItem === "function" && typeof window.localStorage.getItem === "function" && typeof window.localStorage.removeItem === "function" && typeof window.localStorage.clear === "function";
|
|
89677
89734
|
}
|
|
89678
89735
|
}]);
|
|
89679
89736
|
|
|
@@ -90622,7 +90679,8 @@ var Sound$1 = /*#__PURE__*/function (_Entity) {
|
|
|
90622
90679
|
}, {
|
|
90623
90680
|
key: "toJSON",
|
|
90624
90681
|
value: function toJSON() {
|
|
90625
|
-
|
|
90682
|
+
var parseJSON = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
90683
|
+
return _objectSpread2$1(_objectSpread2$1({}, _get(_getPrototypeOf(Sound.prototype), "toJSON", this).call(this, parseJSON)), {}, {
|
|
90626
90684
|
source: this.source,
|
|
90627
90685
|
loop: this.loop,
|
|
90628
90686
|
loopStart: this.loopStart,
|
|
@@ -91179,7 +91237,8 @@ var Sound = /*#__PURE__*/function (_Entity) {
|
|
|
91179
91237
|
}, {
|
|
91180
91238
|
key: "toJSON",
|
|
91181
91239
|
value: function toJSON() {
|
|
91182
|
-
|
|
91240
|
+
var parseJSON = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
91241
|
+
return _objectSpread2$1(_objectSpread2$1({}, _get(_getPrototypeOf(Sound.prototype), "toJSON", this).call(this, parseJSON)), {}, {
|
|
91183
91242
|
source: this.source,
|
|
91184
91243
|
loop: this.loop,
|
|
91185
91244
|
loopStart: this.loopStart,
|
|
@@ -91550,7 +91609,8 @@ var addHitBox = function addHitBox(element) {
|
|
|
91550
91609
|
}, {
|
|
91551
91610
|
key: "toJSON",
|
|
91552
91611
|
value: function toJSON() {
|
|
91553
|
-
|
|
91612
|
+
var parseJSON = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
91613
|
+
return _objectSpread2$1(_objectSpread2$1({}, _get(_getPrototypeOf(Light.prototype), "toJSON", this).call(this, parseJSON)), {}, {
|
|
91554
91614
|
type: this.getEntityType(),
|
|
91555
91615
|
color: this.getColor(),
|
|
91556
91616
|
intensity: this.getIntensity(),
|
|
@@ -91889,7 +91949,8 @@ var SunLight = /*#__PURE__*/function (_Light) {
|
|
|
91889
91949
|
}, {
|
|
91890
91950
|
key: "toJSON",
|
|
91891
91951
|
value: function toJSON() {
|
|
91892
|
-
|
|
91952
|
+
var parseJSON = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
91953
|
+
return _objectSpread2$1(_objectSpread2$1({}, _get(_getPrototypeOf(SunLight.prototype), "toJSON", this).call(this, parseJSON)), {}, {
|
|
91893
91954
|
target: this.getTarget(),
|
|
91894
91955
|
bias: this.getBias(),
|
|
91895
91956
|
mapSize: this.getMapSize(),
|
|
@@ -92120,8 +92181,8 @@ var PointLight = /*#__PURE__*/function (_Light) {
|
|
|
92120
92181
|
}
|
|
92121
92182
|
}, {
|
|
92122
92183
|
key: "toJSON",
|
|
92123
|
-
value: function toJSON() {
|
|
92124
|
-
return _objectSpread2$1(_objectSpread2$1({}, _get(_getPrototypeOf(PointLight.prototype), "toJSON", this).call(this)), {}, {
|
|
92184
|
+
value: function toJSON(parseJSON) {
|
|
92185
|
+
return _objectSpread2$1(_objectSpread2$1({}, _get(_getPrototypeOf(PointLight.prototype), "toJSON", this).call(this, parseJSON)), {}, {
|
|
92125
92186
|
distance: this.getDistance(),
|
|
92126
92187
|
decay: this.getDecay(),
|
|
92127
92188
|
bias: this.getBias(),
|
|
@@ -92418,7 +92479,8 @@ var SpotLight = /*#__PURE__*/function (_Light) {
|
|
|
92418
92479
|
}, {
|
|
92419
92480
|
key: "toJSON",
|
|
92420
92481
|
value: function toJSON() {
|
|
92421
|
-
|
|
92482
|
+
var parseJSON = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
92483
|
+
return _objectSpread2$1(_objectSpread2$1({}, _get(_getPrototypeOf(SpotLight.prototype), "toJSON", this).call(this, parseJSON)), {}, {
|
|
92422
92484
|
target: this.getTarget(),
|
|
92423
92485
|
distance: this.getDistance(),
|
|
92424
92486
|
decay: this.getDecay(),
|
|
@@ -92664,7 +92726,8 @@ var SpotLight = /*#__PURE__*/function (_Light) {
|
|
|
92664
92726
|
}, {
|
|
92665
92727
|
key: "toJSON",
|
|
92666
92728
|
value: function toJSON() {
|
|
92667
|
-
|
|
92729
|
+
var parseJSON = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
92730
|
+
return _objectSpread2$1(_objectSpread2$1({}, _get(_getPrototypeOf(Light.prototype), "toJSON", this).call(this, parseJSON)), {}, {
|
|
92668
92731
|
type: this.getEntityType(),
|
|
92669
92732
|
color: this.getColor(),
|
|
92670
92733
|
intensity: this.getIntensity(),
|
|
@@ -92795,7 +92858,8 @@ var HemisphereLight = /*#__PURE__*/function (_Light) {
|
|
|
92795
92858
|
}, {
|
|
92796
92859
|
key: "toJSON",
|
|
92797
92860
|
value: function toJSON() {
|
|
92798
|
-
|
|
92861
|
+
var parseJSON = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
92862
|
+
return _objectSpread2$1(_objectSpread2$1({}, _get(_getPrototypeOf(HemisphereLight.prototype), "toJSON", this).call(this, parseJSON)), {}, {
|
|
92799
92863
|
color: this.getColor()
|
|
92800
92864
|
});
|
|
92801
92865
|
}
|