File size: 477 Bytes
2b7aae2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
const Cache = {
	enabled: false,

	files: {},

	add: function (key, file) {
		if (this.enabled === false) return;

		// console.log( 'THREE.Cache', 'Adding key:', key );

		this.files[key] = file;
	},

	get: function (key) {
		if (this.enabled === false) return;

		// console.log( 'THREE.Cache', 'Checking key:', key );

		return this.files[key];
	},

	remove: function (key) {
		delete this.files[key];
	},

	clear: function () {
		this.files = {};
	},
};

export { Cache };