mirror of
https://github.com/unanmed/HumanBreak.git
synced 2025-10-30 02:42:57 +08:00
feat: TextureStore 根据别名获取 id
This commit is contained in:
parent
4fd2fa168b
commit
dc98244a08
@ -99,4 +99,8 @@ export class TextureStore implements ITextureStore {
|
|||||||
aliasOf(identifier: number): string | undefined {
|
aliasOf(identifier: number): string | undefined {
|
||||||
return this.aliasInvMap.get(identifier);
|
return this.aliasInvMap.get(identifier);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
identifierOf(alias: string): number | undefined {
|
||||||
|
return this.aliasMap.get(alias);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -110,7 +110,7 @@ export class TextureMaxRectsStreamComposer
|
|||||||
readonly maxWidth: number,
|
readonly maxWidth: number,
|
||||||
readonly maxHeight: number,
|
readonly maxHeight: number,
|
||||||
readonly padding: number,
|
readonly padding: number,
|
||||||
options: IOption
|
options?: IOption
|
||||||
) {
|
) {
|
||||||
this.packer = new MaxRectsPacker<MaxRectsRectangle>(
|
this.packer = new MaxRectsPacker<MaxRectsRectangle>(
|
||||||
this.maxWidth,
|
this.maxWidth,
|
||||||
|
|||||||
@ -219,6 +219,12 @@ export interface ITextureStore {
|
|||||||
*/
|
*/
|
||||||
fromAlias(alias: string): ITexture | null;
|
fromAlias(alias: string): ITexture | null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据贴图对象别名获取贴图对象 id
|
||||||
|
* @param alias 贴图对象别名
|
||||||
|
*/
|
||||||
|
identifierOf(alias: string): number | undefined;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据贴图对象获取此贴图对象在此控制器中的 id,如果贴图不在此控制器,返回 `undefined`
|
* 根据贴图对象获取此贴图对象在此控制器中的 id,如果贴图不在此控制器,返回 `undefined`
|
||||||
* @param texture 贴图对象
|
* @param texture 贴图对象
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user