mirror of
https://github.com/unanmed/HumanBreak.git
synced 2026-12-02 07:15:02 +08:00
音乐从某个时刻开始播放
This commit is contained in:
1 parent
77efd767ee
commit
d4c03cdaec
3 files changed
+22
-15
No files matched your search
@@ -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
@@ -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();
|
||||
Reference in new issue
Block a user