音乐从某个时刻开始播放

This commit is contained in:
AncTe committed 2023-06-18 22:42:09 +08:00
1 parent 77efd767ee
commit d4c03cdaec
3 files changed
+22 -15

No files matched your search

+5
View File
@@ -1,6 +1,11 @@
export abstract class ResourceController<D, T = D> {
list: Record<string, T> = {};
/**
* 添加一个资源
* @param uri 资源uri
* @param data 资源数据
*/
abstract add(uri: string, data: D): void;
remove(uri: string) {
+11 -13
View File
@@ -271,19 +271,6 @@ class ResourceStore<T extends ResourceType> extends Map<string, Resource<T>> {
}
}
declare global {
interface AncTe {
/** 游戏资源 */
resource: ResourceStore<Exclude<ResourceType, 'zip'>>;
zipResource: ResourceStore<'zip'>;
}
}
ancTe.resource = new ResourceStore();
ancTe.zipResource = new ResourceStore();
console.log(JSZip.external.Promise);
export function getTypeByResource(resource: string): ResourceType {
const type = resource.split('.')[0];
@@ -301,3 +288,14 @@ export function getZipFormatByType(type: ResourceType): 'arraybuffer' | 'text' {
if (type === 'text' || type === 'json') return 'text';
else return 'arraybuffer';
}
declare global {
interface AncTe {
/** 游戏资源 */
resource: ResourceStore<Exclude<ResourceType, 'zip'>>;
zipResource: ResourceStore<'zip'>;
}
}
ancTe.resource = new ResourceStore();
ancTe.zipResource = new ResourceStore();