functionGameLib(){}var__DATE__="Sun Nov 19 2017 19:43:14 GMT+0100 (CET)";if(void0===GameLib.D3&&(GameLib.D3=function(){}),void0===GameLib.D3.API&&(GameLib.D3.API=function(){}),void0===GameLib.API&&(GameLib.API=function(){}),void0===GameLib.D3.Runtime&&(GameLib.D3.Runtime=function(){}),void0===Q){if("undefined"==typeofrequire)throwconsole.warn("You need the Q promise library for the GameLib.D3"),newError("You need the Q promise library for the GameLib.D3");varQ=require("q")}if(void0===_){if("undefined"==typeofrequire)throwconsole.warn("You need the lodash library for the GameLib.D3"),newError("You need the lodash library for the GameLib.D3");var_=require("lodash")}console.log("Loading GameLib compiled at: "+__DATE__),GameLib.Event=function(){},GameLib.Event.Subscriptions={},GameLib.Event.OnceSubscriptions={},GameLib.Event.WINDOW_RESIZE=1,GameLib.Event.PARENT_SCENE_CHANGE=2,GameLib.Event.PARENT_ENTITY_CHANGE=3,GameLib.Event.INSTANCE_CLONED=4,GameLib.Event.LOAD_IMAGE=5,GameLib.Event.NEW_ENTITY=6,GameLib.Event.MATERIAL_TYPE_CHANGED=7,GameLib.Event.SAVE_COMPONENT=8,GameLib.Event.SAVE_COMPONENT_ERROR=9,GameLib.Event.COMPONENT_SAVED=10,GameLib.Event.LOAD_COMPONENT=11,GameLib.Event.LOAD_COMPONENT_ERROR=12,GameLib.Event.LOGGED_IN=13,GameLib.Event.COMPONENT_CREATED=14,GameLib.Event.COMPONENT_CLONED=15,GameLib.Event.TEXTURE_ANIMATED_CHANGE=16,GameLib.Event.ANIMATE_TEXTURE_INSTANCE=17,GameLib.Event.REMOVE_PARTICLE_ENGINE=18,GameLib.Event.PAUSE=19,GameLib.Event.TEXTURE_INSTANCE_UPDATED=20,GameLib.Event.PLAY_AUDIO=21,GameLib.Event.MATERIAL_INSTANCE_UPDATED=22,GameLib.Event.PAUSE_AUDIO=23,GameLib.Event.MESH_INSTANCE_UPDATED=24,GameLib.Event.STOP_AUDIO=25,GameLib.Event.LIGHT_INSTANCE_UPDATED=26,GameLib.Event.DELETE_COMPONENT=27,GameLib.Event.COMPONENT_DOWNLOAD_COMPLETE=28,GameLib.Event.COMPONENTS_LINKED=29,GameLib.Event.UNRESOLVED_DEPENDENCIES_UPDATE=30,GameLib.Event.REGISTER_UPDATE=31,GameLib.Event.BUILD_GUI=32,GameLib.Event.REMOVE_MESH=33,GameLib.Event.MESH_SELECTED=34,GameLib.Event.MESH_DESELECTED=35,GameLib.Event.COMPONENT_REGISTER=36,GameLib.Event.IMAGE_NOT_FOUND=37,GameLib.Event.BLENDER_DATA_RECEIVED=38,GameLib.Event.IMAGE_UPLOAD_COMPLETE=39,GameLib.Event.REMOVE_COMPONENT=40,GameLib.Event.KEY_DOWN=41,GameLib.Event.KEY_UP=42,GameLib.Event.RENDER=43,GameLib.Event.EVENT_LIST=44,GameLib.Event.COMPILE_SUCCESS=45,GameLib.Event.COMPILE_FAILED=46,GameLib.Event.IMAGE_CHANGED=47,GameLib.Event.PARENT_ENTITY_CHANGED=48,GameLib.Event.MATERIAL_TEXTURES_UPDATED=49,GameLib.Event.DELETE_COMPONENT_ERROR=50,GameLib.Event.COMPONENT_DELETED=51,GameLib.Event.COMPONENT_TYPES_UPDATED=52,GameLib.Event.AUDIO_ENDED=53,GameLib.Event.COMPONENT_LINKED=54,GameLib.Event.DONE_SAVING=55,GameLib.Event.BEFORE_RENDER=56,GameLib.Event.AFTER_RENDER=57,GameLib.Event.ARRAY_ITEM_ADDED=58,GameLib.Event.INSTANCE_CREATED=59,GameLib.Event.VISUALIZE=60,GameLib.Event.STOP_VISUALIZE=61,GameLib.Event.FETCH_COMPONENT_TYPES=62,GameLib.Event.FETCH_COMPONENTS=63,GameLib.Event.GET_API_URL=64,GameLib.Event.GET_PHYSICS_IMPLEMENTATION=65,GameLib.Event.PARENT_WORLD_CHANGE=66,GameLib.Event.ANIMATE=67,GameLib.Event.ANIMATION_COMPILE_SUCCESS=68,GameLib.Event.ANIMATION_COMPILE_FAILED=69,GameLib.Event.SAVING=70,GameLib.Event.GAME_OVER=71,GameLib.Event.GAME_START=72,GameLib.Event.TOUCH_START=73,GameLib.Event.TOUCH_END=74,GameLib.Event.TOUCH_MOVE=75,GameLib.Event.TOUCH_CANCEL=76,GameLib.Event.GET_REMOTE_API_URL=77,GameLib.Event.GET_GRAPHICS_IMPLEMENTATION=78,GameLib.Event.DELAYED_INSTANCE_ENCOUNTERED=79,GameLib.Event.GET_CODER_IMPLEMENTATION=80,GameLib.Event.ANIMATION_MESH_ADDED=81,GameLib.Event.ANIMATION_MESH_REMOVED=82,GameLib.Event.GET_SCENE=83,GameLib.Event.CUSTOM_CODE_WINDOW_RESIZE=84,GameLib.Event.LOAD_FONT=85,GameLib.Event.FONT_NOT_FOUND=86,GameLib.Event.STOP_ALL_AUDIO=87,GameLib.Event.REGISTER_DEPENDENCIES=88,GameLib.Event.GAME_LOADED=89,GameLib.Event.GAME_RESTART=90,GameLib.Event.LOAD_PROGRESS=91,GameLib.Event.ENTITY_LOADED=92,GameLib.Event.MOUSE_DOWN=93,GameLib.Event.MOUSE_MOVE=94,GameLib.Event.MOUSE_WHEEL=95,GameLib.Event.MOUSE_UP=96,GameLib.Event.PARTICLE_INSTANCE_UP
;throwconsole.warn("Unsupported object matrix type - whats your DB version?"),newError("Unsupported object matrix type - whats your DB version?")},GameLib.API.Matrix4.prototype.rotationMatrixX=function(e){returnthis.identity(),this.rows[1]=newGameLib.API.Vector4(0,Math.cos(e),-1*Math.sin(e),0),this.rows[2]=newGameLib.API.Vector4(0,Math.sin(e),Math.cos(e),0),this},GameLib.API.Matrix4.prototype.rotationMatrixY=function(e){returnthis.identity(),this.rows[0]=newGameLib.API.Vector4(Math.cos(e),0,Math.sin(e),0),this.rows[2]=newGameLib.API.Vector4(-1*Math.sin(e),0,Math.cos(e),0),this},GameLib.API.Matrix4.prototype.rotationMatrixZ=function(e){returnthis.identity(),this.rows[0]=newGameLib.API.Vector4(Math.cos(e),-1*Math.sin(e),0,0),this.rows[1]=newGameLib.API.Vector4(Math.sin(e),Math.cos(e),0,0),this},GameLib.API.Matrix4.prototype.rotateX=function(e,t){returnthis.identity(),this.rotationMatrixX(e),this.multiply(t)},GameLib.API.Matrix4.prototype.rotateY=function(e,t){returnthis.identity(),this.rotationMatrixY(e),this.multiply(t)},GameLib.API.Matrix4.prototype.rotateZ=function(e,t){returnthis.identity(),this.rotationMatrixZ(e),this.multiply(t)},GameLib.API.Matrix4.prototype.multiply=function(e){returneinstanceofGameLib.API.Quaternion||einstanceofGameLib.API.Vector4?newGameLib.API.Quaternion(this.rows[0].x*e.x+this.rows[0].y*e.y+this.rows[0].z*e.z+this.rows[0].w*e.w,this.rows[1].x*e.x+this.rows[1].y*e.y+this.rows[1].z*e.z+this.rows[1].w*e.w,this.rows[2].x*e.x+this.rows[2].y*e.y+this.rows[2].z*e.z+this.rows[2].w*e.w,this.rows[3].x*e.x+this.rows[3].y*e.y+this.rows[3].z*e.z+this.rows[3].w*e.w):einstanceofGameLib.API.Vector3?newGameLib.API.Vector3(this.rows[0].x*e.x+this.rows[0].y*e.y+this.rows[0].z*e.z,this.rows[1].x*e.x+this.rows[1].y*e.y+this.rows[1].z*e.z,this.rows[2].x*e.x+this.rows[2].y*e.y+this.rows[2].z*e.z):void0},GameLib.API.Matrix4.prototype.identity=function(){this.rows=[newGameLib.API.Vector4(1,0,0,0),newGameLib.API.Vector4(0,1,0,0),newGameLib.API.Vector4(0,0,1,0),newGameLib.API.Vector4(0,0,0,1)]},GameLib.API.Mouse=function(e,t,i,n,s){GameLib.Utils.UndefinedOrNull(s)&&(s=null),this.parentEntity=s,GameLib.Utils.UndefinedOrNull(e)&&(e=GameLib.Utils.RandomId()),this.id=e,GameLib.Utils.UndefinedOrNull(t)&&(t="Mouse ("+this.id+")"),this.name=t,GameLib.Utils.UndefinedOrNull(i)&&(i=0),this.x=i,GameLib.Utils.UndefinedOrNull(n)&&(n=0),this.y=n},GameLib.API.Mouse.prototype=Object.create(GameLib.Component.prototype),GameLib.API.Mouse.prototype.constructor=GameLib.API.Mouse,GameLib.API.Mouse.FromObject=function(e){returnnewGameLib.API.Mouse(e.id,e.name,e.x,e.y,e.parentEntity)},GameLib.API.Quaternion=function(e,t,i,n,s,a){GameLib.Utils.UndefinedOrNull(e)&&(e=0),this.x=e,GameLib.Utils.UndefinedOrNull(t)&&(t=0),this.y=t,GameLib.Utils.UndefinedOrNull(i)&&(i=0),this.z=i,GameLib.Utils.UndefinedOrNull(n)&&(n=1),this.w=n,GameLib.Utils.UndefinedOrNull(s)&&(s=newGameLib.API.Vector3),this.axis=s,GameLib.Utils.UndefinedOrNull(a)&&(a=0),this.angle=a},GameLib.API.Quaternion.prototype.translate=function(e){returnthis.x+=e.x,this.y+=e.y,this.z+=e.z,this},GameLib.API.Quaternion.prototype.copy=function(){returnnewGameLib.API.Quaternion(this.x,this.y,this.z,this.w)},GameLib.API.Quaternion.prototype.normalize=function(){vare=this.x*this.x+this.y*this.y+this.z*this.z;if(e<1e-6)returnthis;vart=1/Math.sqrt(e);this.x*=t,this.y*=t,this.z*=t},GameLib.API.Quaternion.prototype.multiply=function(e){vart,i,n,s,a=e,o=this;if(einstanceofGameLib.API.Matrix4)returnt=a.rows[0].x*o.x+a.rows[0].y*o.y+a.rows[0].z*o.z+a.rows[0].w*o.w,i=a.rows[1].x*o.x+a.rows[1].y*o.y+a.rows[1].z*o.z+a.rows[1].w*o.w,n=a.rows[2].x*o.x+a.rows[2].y*o.y+a.rows[2].z*o.z+a.rows[2].w*o.w,s=a.rows[3].x*o.x+a.rows[3].y*o.y+a.rows[3].z*o.z+a.rows[3].w*o.w,this.x=t,this.y=i,this.z=n,this.w=s,this;if(einstanceofGameLib.API.Quaternion)returnt=a.x*o.x-a.y*o.y-a.z*o.z-a.w*a.w,i=a.x*o.y+a.y*o.x-a.z*o.w+a.w*a.z,n=a.x*o.z+a.y*o.w+a.z*o.x-a.w*a.y,s=a.x*o.w-a.y*o.z+a.z*o.y+a.w*a.x,this.x=t,this.y=i,this.z=n,this.w=s,this;throwconsole.log("Thisfunctionalitynotimpl
GameLib.D3.Texture.TYPE_NEAREST_MIPMAP_LINEAR_FILTER=1005,GameLib.D3.Texture.TYPE_LINEAR_FILTER=1006,GameLib.D3.Texture.TYPE_LINEAR_MIPMAP_NEAREST_FILTER=1007,GameLib.D3.Texture.TYPE_LINEAR_MIPMAP_LINEAR_FILTER=1008,GameLib.D3.Texture.TYPE_UNSIGNED_BYTE=1009,GameLib.D3.Texture.TYPE_BYTE=1010,GameLib.D3.Texture.TYPE_SHORT=1011,GameLib.D3.Texture.TYPE_UNSIGNED_SHORT=1012,GameLib.D3.Texture.TYPE_INT=1013,GameLib.D3.Texture.TYPE_UNSIGNED_INT=1014,GameLib.D3.Texture.TYPE_FLOAT=1015,GameLib.D3.Texture.TYPE_HALF_FLOAT=1025,GameLib.D3.Texture.TYPE_LINEAR_ENCODING=3e3,GameLib.D3.Texture.TYPE_SRGB_ENCODING=3001,GameLib.D3.Texture.TYPE_GAMMA_ENCODING=3007,GameLib.D3.Texture.TYPE_RGBE_ENCODING=3002,GameLib.D3.Texture.TYPE_LOG_LUV_ENCODING=3003,GameLib.D3.Texture.TYPE_RGBM7_ENCODING=3004,GameLib.D3.Texture.TYPE_RGBM16_ENCODING=3005,GameLib.D3.Texture.TYPE_RGBD_ENCODING=3006,GameLib.D3.Texture.TEXTURE_TYPE_NORMAL=1,GameLib.D3.Texture.TEXTURE_TYPE_CUBE=2,GameLib.D3.Texture.TEXTURE_TYPE_CANVAS=3,GameLib.D3.Texture.prototype.createInstance=function(){if(this.typeId===GameLib.D3.Texture.TEXTURE_TYPE_CUBE){if(6!==this.images.length)thrownewError("not enough images for cube texture");vare=this.images.map(function(e){if(GameLib.Utils.UndefinedOrNull(e))thrownewError("no image");if(GameLib.Utils.UndefinedOrNull(e.instance))thrownewError("no image instance");returne.instance});this.instance=newTHREE.CubeTexture(e)}elseif(this.typeId===GameLib.D3.Texture.TEXTURE_TYPE_NORMAL)GameLib.Utils.UndefinedOrNull(this.image)||GameLib.Utils.UndefinedOrNull(this.image.instance)?this.instance=newTHREE.Texture:this.instance=newTHREE.Texture(this.image.instance);elseif(this.typeId===GameLib.D3.Texture.TEXTURE_TYPE_CANVAS)if(GameLib.Utils.UndefinedOrNull(this.canvas))this.instance=newTHREE.Texture;else{if(GameLib.Utils.UndefinedOrNull(this.canvas.instance))thrownewError("no canvas instance");this.instance=newTHREE.Texture(this.canvas.instance)}this.mapping=this.instance.mapping,this.encoding=this.instance.encoding,this.format=this.instance.format,this.instance.name=this.name,this.instance.flipY=this.flipY,this.instance.offset.x=this.offset.x,this.instance.offset.y=this.offset.y,this.instance.repeat.x=this.repeat.x,this.instance.repeat.y=this.repeat.y,this.instance.wrapS=this.wrapS,this.instance.wrapT=this.wrapT,this.instance.needsUpdate=!0,GameLib.Component.prototype.createInstance.call(this)},GameLib.D3.Texture.prototype.updateInstance=function(e){if(GameLib.Utils.UndefinedOrNull(this.instance))try{returnvoidthis.createInstance()}catch(e){console.error(e)}if(GameLib.Utils.UndefinedOrNull(e))thrownewError("need to specify a property");if("image"===e){if(this.typeId===GameLib.D3.Texture.TEXTURE_TYPE_NORMAL){if(GameLib.Utils.UndefinedOrNull(this.image)&&this.instance.image)try{this.createInstance()}catch(e){console.error(e)}if(this.image&&this.image.instance&&this.instance.image!==this.image.instance)try{this.createInstance()}catch(e){console.error(e)}}elseif(this.typeId===GameLib.D3.Texture.TEXTURE_TYPE_CANVAS){if(GameLib.Utils.UndefinedOrNull(this.canvas)&&this.instance.canvas)try{this.createInstance()}catch(e){console.error(e)}if(this.canvas&&this.canvas.instance&&this.instance.image!==this.canvas.instance)try{this.createInstance()}catch(e){console.error(e)}}elsethis.typeId===GameLib.D3.Texture.TEXTURE_TYPE_CUBE&&console.log("todo : cube images change check here");this.publish(GameLib.Event.IMAGE_CHANGED,{texture:this}),this.instance.needsUpdate=!0}"name"===e&&(this.instance.name=this.name),"flipY"===e&&(this.instance.flipY=this.flipY),"encoding"===e&&(this.instance.encoding=this.encoding),"offset"===e&&(this.instance.offset.x=this.offset.x,this.instance.offset.y=this.offset.y),"repeat"===e&&(this.instance.repeat.x=this.repeat.x,this.instance.repeat.y=this.repeat.y),"mapping"===e&&(this.instance.mapping=this.mapping),"format"===e&&(this.instance.format=this.format),"wrapS"===e&&(this.instance.wrapS=this.wrapS),"wrapT"===e&&(this.instance.wrapT=this.wrapT),"animated"===e&&GameLib.Event.Emit(GameLib.Event.TEXTURE_ANIMATED_CHANGE,{texture
e.backupScaleXDescriptor&&(Object.defineProperty(e.scale,"x",e.backupScaleXDescriptor),deletee.backupScaleXDescriptor,t=!0),e.backupScaleYDescriptor&&(Object.defineProperty(e.scale,"y",e.backupScaleYDescriptor),deletee.backupScaleYDescriptor,t=!0),e.backupScaleZDescriptor&&(Object.defineProperty(e.scale,"z",e.backupScaleZDescriptor),deletee.backupScaleZDescriptor,t=!0),this.latest[e.id]&&(e.rotation.x=this.latest[e.id].rotation.x,e.rotation.y=this.latest[e.id].rotation.y,e.rotation.z=this.latest[e.id].rotation.z,e.position.x=this.latest[e.id].position.x,e.position.y=this.latest[e.id].position.y,e.position.z=this.latest[e.id].position.z,e.scale.x=this.latest[e.id].scale.x,e.scale.y=this.latest[e.id].scale.y,e.scale.z=this.latest[e.id].scale.z,e.quaternion.axis.x=this.latest[e.id].quaternion.axis.x,e.quaternion.axis.y=this.latest[e.id].quaternion.axis.y,e.quaternion.axis.z=this.latest[e.id].quaternion.axis.z,e.quaternion.angle=this.latest[e.id].quaternion.angle,deletethis.latest[e.id],t=!0),this.animations[e.id]&&(deletethis.animations[e.id],t=!0),t&&e.updateInstance()},GameLib.System.Animation.prototype.attachAnimation=function(e,t){if(this.latest[t.id]={rotation:{x:t.rotation.x,y:t.rotation.y,z:t.rotation.z},position:{x:t.position.x,y:t.position.y,z:t.position.z},scale:{x:t.scale.x,y:t.scale.y,z:t.scale.z},quaternion:{axis:{x:t.quaternion.axis.x,y:t.quaternion.axis.y,z:t.quaternion.axis.z},angle:t.quaternion.angle}},this.animations[t.id]=[],t.backupRotationXDescriptor)thrownewError("already a backed up x descriptor");t.backupQuaternionAngleDescriptor=Object.getOwnPropertyDescriptor(t.quaternion,"angle"),t.backupQuaternionAxisXDescriptor=Object.getOwnPropertyDescriptor(t.quaternion.axis,"x"),t.backupQuaternionAxisYDescriptor=Object.getOwnPropertyDescriptor(t.quaternion.axis,"y"),t.backupQuaternionAxisZDescriptor=Object.getOwnPropertyDescriptor(t.quaternion.axis,"z"),t.backupRotationXDescriptor=Object.getOwnPropertyDescriptor(t.rotation,"x"),t.backupRotationYDescriptor=Object.getOwnPropertyDescriptor(t.rotation,"y"),t.backupRotationZDescriptor=Object.getOwnPropertyDescriptor(t.rotation,"z"),t.backupPositionXDescriptor=Object.getOwnPropertyDescriptor(t.position,"x"),t.backupPositionYDescriptor=Object.getOwnPropertyDescriptor(t.position,"y"),t.backupPositionZDescriptor=Object.getOwnPropertyDescriptor(t.position,"z"),t.backupScaleXDescriptor=Object.getOwnPropertyDescriptor(t.scale,"x"),t.backupScaleYDescriptor=Object.getOwnPropertyDescriptor(t.scale,"y"),t.backupScaleZDescriptor=Object.getOwnPropertyDescriptor(t.scale,"z"),Object.defineProperty(t.quaternion,"angle",{get:this.getProperty(t,"angle","quaternion"),set:this.setProperty(t,e,"angle","quaternion"),configurable:!0}),Object.defineProperty(t.quaternion.axis,"x",{get:this.getSubProperty(t,"x","quaternion","axis"),set:this.setSubProperty(t,e,"x","quaternion","axis"),configurable:!0}),Object.defineProperty(t.quaternion.axis,"y",{get:this.getSubProperty(t,"y","quaternion","axis"),set:this.setSubProperty(t,e,"y","quaternion","axis"),configurable:!0}),Object.defineProperty(t.quaternion.axis,"z",{get:this.getSubProperty(t,"z","quaternion","axis"),set:this.setSubProperty(t,e,"z","quaternion","axis"),configurable:!0}),Object.defineProperty(t.rotation,"x",{get:this.getProperty(t,"x","rotation"),set:this.setProperty(t,e,"x","rotation"),configurable:!0}),Object.defineProperty(t.rotation,"y",{get:this.getProperty(t,"y","rotation"),set:this.setProperty(t,e,"y","rotation"),configurable:!0}),Object.defineProperty(t.rotation,"z",{get:this.getProperty(t,"z","rotation"),set:this.setProperty(t,e,"z","rotation"),configurable:!0}),Object.defineProperty(t.scale,"x",{get:this.getProperty(t,"x","scale"),set:this.setProperty(t,e,"x","scale"),configurable:!0}),Object.defineProperty(t.scale,"y",{get:this.getProperty(t,"y","scale"),set:this.setProperty(t,e,"y","scale"),configurable:!0}),Object.defineProperty(t.scale,"z",{get:this.getProperty(t,"z","scale"),set:this.setProperty(t,e,"z","scale"),configurable:!0}),Object.defineProperty(t.position,"x",{get:this.getProperty(t,"x","position"),set
;returnGameLib.Utils.PushUnique(e,t),i.map(function(t){GameLib.Utils.PushUnique(e,t)}),e}.bind(this),[])),this.components.sort(function(e,t){returne.componentType>t.componentType?1:e.componentType<t.componentType?-1:0});vari=this.components.reduce(function(e,t){vari=e.pop();returnt.componentType===i.componentType?(i.components.push(t),e.push(i),e):t.componentType!==i.componentType?(e.push(i),e.push({componentType:t.componentType,components:[t]}),e):void0},[{componentType:this.components[0].componentType,components:[]}]);this.components.map(function(e){vart=!1;i.map(function(i){i.componentType===e.componentType&&1===i.components.length&&i.components[0]===e&&(t=!0)}),t||GameLib.Utils.PushUnique(i,{componentType:e.componentType,components:[e]})}),i.map(function(e){e.components.length<1&&console.warn("invalid number of components");vari={template:{parentEntity:e.components[0].parentEntity},affected:[e.components[0]],componentType:e.componentType};for(varnine.components[0])(e.components[0].hasOwnProperty(n)||"function"==typeofe.components[0][n])&&("function"==typeofe.components[0][n]?i.template[n]=function(e){returnfunction(){this.affected.map(function(t){t[e].bind(t)()})}.bind(i)}(n):i.template[n]=e.components[0][n]);vars,a=e.components.reduce(function(t,i){if(i===e.components[0])returnt;for(varnini)if(i.hasOwnProperty(n)){if(!t.template.hasOwnProperty(n))continue;if(t.template[n]instanceofGameLib.Vector2||t.template[n]instanceofGameLib.Vector3||t.template[n]instanceofGameLib.Vector4||t.template[n]instanceofGameLib.Quaternion){t.template[n].equals(i[n])||deletet.template[n];continue}t.template[n]!==i[n]&&deletet.template[n]}returnt.affected.push(i),t},i);s=GameLib.Utils.UndefinedOrNull(a.template.name)?GameLib.Component.GetComponentName(a.componentType)+" (All Selected ("+a.affected.length+"))":a.template.name;varo=t.addFolder(s);if(o)for(varrina.template)if(a.template.hasOwnProperty(r)||"function"==typeofa.template[r]){if("function"==typeofa.template[r]){o.add(a.template,r);continue}if(a.template[r]instanceofGameLib.Vector2||a.template[r]instanceofGameLib.Vector3||a.template[r]instanceofGameLib.Vector4){this.buildVectorControl(o,a,r);continue}if(a.template[r]instanceofGameLib.Quaternion&&this.buildQuaternionControl(o,a,r),"parentEntity"===r||"parentWorld"===r||"parentMesh"===r||"parentScene"===r){this.buildParentSelectionControl(o,a,r);continue}if(a.template[r]instanceofArray){if("vertices"===r||"faces"===r)continue;a.template.linkedObjects&&a.template.linkedObjects[r]instanceofArray&&this.buildArrayManagerControl(o,a,r);continue}if(a.template[r]instanceofGameLib.Color){this.buildColorControl(o,a,r);continue}if("object"==typeofa.template[r]){(a.template[r]instanceofGameLib.Component||a.template.linkedObjects&&a.template.linkedObjects[r])&&this.buildSelectControl(o,a,r);continue}this.buildControl(o,a,r)}}.bind(this))}}.bind(this))},GameLib.System.GUI.prototype.meshDeleted=function(e){e.meshes.map(function(e){this.meshDeslected({mesh:e})}.bind(this)),this.buildGUI(null)},GameLib.System.GUI.prototype.removeComponent=function(e){vart=this.backupComponents.indexOf(e.component);-1!==t&&this.backupComponents.splice(t,1),-1!==(t=this.components.indexOf(e.component))&&this.components.splice(t,1)},GameLib.System.GUI.prototype.newEntity=function(e){},GameLib.System.GUI.prototype.stop=function(){GameLib.System.prototype.stop.call(this),this.guis.map(function(e){e.domElement.instance.parentElement.removeChild(e.instance.domElement)}),deletedat.GUI.removeEmtpyFolders,deletedat.GUI.removeAllFolders,this.buildGUISubscription.remove(),this.meshDeletedSubscription.remove(),this.meshSelectedSubscription.remove(),this.meshDeselectedSubscription.remove(),this.newEntitySubscription.remove(),this.componentRemovedSubscription.remove(),this.guis=[]},GameLib.System.Input=function(e,t){GameLib.System.call(this,e),this.graphics=t,this.graphics.isNotThreeThrow(),this.selectAll=!1,this.controlLeft=!1,this.sensitivityCounter=0,this.editorControls=[],this.touchControls=[],this.keyboardControls=[],this.mouseCont