import { EResType, ResBaseAsset } from "./ResBaseAsset";

const { ccclass, menu, disallowMultiple } = cc._decorator;

/**
 * 精灵图集（TexturePacker 打包的 plist + png）（不是 AutoAtlas）
 */
@ccclass
@disallowMultiple
@menu('UI/ResSpriteAtlas')
export default class ResSpriteAtlas extends ResBaseAsset<cc.SpriteAtlas> {
    protected readonly ResType: EResType = EResType.SpriteAtlas;
    /**
     * 通过 url 设置精灵 
     * @param bundle 
     * @param url 
     * @param cb 
     * @param group 加载分组，默认为 ELoadingGroup.dft
     * @param priority 优先级越小，越先加载，默认为 0
     * @returns 
     */
    LoadSpriteAtlas(bundle: string, url: string, cb?: (atlas: cc.SpriteAtlas) => void) {
        this.loadAsset(bundle, url, cc.SpriteAtlas, cb);
    }
}
