text: 
  var vec3 = require('gl-vec3')
  
  
  export default function (noa) {
      return {
  
          name: 'mobinventory',
  
          order: 100,
  
          state: {
              mesh: null,
              main: null,
  			chest:false,
  			main:{},
  			opened:false,
  			selected: 0,
  			tempslot:{}
  			
          },
  
  
          onAdd: function (eid, state) {
  			state.mesh=noa.ents.getState(eid, 'entmesh').mesh
            
              
          },
  
  
          onRemove: function (eid, state) {
             
          },
  
  
  
          renderSystem: function (dt, states) {
              // before render move each mesh to its render position, 
              // set by the physics engine or driving logic
  
              states.forEach(state => {
                  var id = state.__id
  				
  				if(state.opened){
  					state.mesh._children[1].rotation.x=-Math.PI/6
  				}else{
  					state.mesh._children[1].rotation.x=0
  				}
  				
              })
          }
  		
  		
  
  
      }
  }
  