diff --git a/package.json b/package.json index 01fcee5..7bca358 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,7 @@ "gulp-concat": "^2.6.0", "gulp-minify": "0.0.14", "gulp-sort": "^2.0.0", + "lodash": "^4.17.1", "q": "^1.4.1", "three": "^0.81.2" }, diff --git a/src/game-lib-a.js b/src/game-lib-a.js index 3855de4..cacc090 100644 --- a/src/game-lib-a.js +++ b/src/game-lib-a.js @@ -13,4 +13,13 @@ if (typeof Q == 'undefined') { } var Q = require('q'); +} + +if (typeof _ == 'undefined') { + if (typeof require == 'undefined') { + console.warn('You need the lowdash library for the GameLib.D3'); + throw new Error('You need the lowdash library for the GameLib.D3'); + } + + var _ = require('_'); } \ No newline at end of file diff --git a/src/game-lib-component-interface.js b/src/game-lib-component-interface.js index 3a5e11d..d2fe4e6 100644 --- a/src/game-lib-component-interface.js +++ b/src/game-lib-component-interface.js @@ -77,4 +77,8 @@ GameLib.D3.ComponentInterface.prototype.onSetParentEntity = function( parentEntity ) { +}; + +GameLib.D3.ComponentInterface.prototype.clone = function() { + return _.cloneDeep(this); }; \ No newline at end of file diff --git a/src/game-lib-scene.js b/src/game-lib-scene.js index ff96ff8..bf1938b 100644 --- a/src/game-lib-scene.js +++ b/src/game-lib-scene.js @@ -448,10 +448,6 @@ GameLib.D3.Scene.LoadScene = function( var mesh = gameLibScene.meshes[m]; - if (!mesh.id) { - mesh.id = GameLib.D3.Tools.RandomId(); - } - console.log("loading mesh " + mesh.name); var geometry = new graphics.instance.Geometry();