HumanBreak/src/core/loader/load.ts

16 lines
423 B
TypeScript
Raw Normal View History

2023-06-09 22:59:20 +08:00
import resource from '../../data/resource.json';
2023-06-14 19:20:24 +08:00
import { Resource, getTypeByResource } from './resource';
2023-06-09 22:59:20 +08:00
2023-06-14 19:20:24 +08:00
const info = resource;
2023-06-09 22:59:20 +08:00
export function readyAllResource() {
info.forEach(v => {
2023-06-14 19:20:24 +08:00
const type = getTypeByResource(v);
if (type === 'zip') {
ancTe.zipResource.set(v, new Resource(v, 'zip'));
2023-06-09 22:59:20 +08:00
} else {
2023-06-14 19:20:24 +08:00
ancTe.resource.set(v, new Resource(v, type));
2023-06-09 22:59:20 +08:00
}
});
}