Cache.js 550 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /**
  2. * @author mrdoob / http://mrdoob.com/
  3. */
  4. THREE.Cache = function () {
  5. this.files = {};
  6. };
  7. THREE.Cache.prototype = {
  8. constructor: THREE.Cache,
  9. add: function ( key, file ) {
  10. // console.log( 'THREE.Cache', 'Adding key:', key );
  11. this.files[ key ] = file;
  12. },
  13. get: function ( key ) {
  14. // console.log( 'THREE.Cache', 'Checking key:', key );
  15. return this.files[ key ];
  16. },
  17. remove: function ( key ) {
  18. delete this.files[ key ];
  19. },
  20. clear: function () {
  21. this.files = {}
  22. }
  23. };
粤ICP备19079148号