// Learn TypeScript:
//  - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html

const { ccclass, property } = cc._decorator;
// cc.macro.CLEANUP_IMAGE_CACHE = true;
// cc.dynamicAtlasManager.enabled = false;
@ccclass
export default class NewClass extends cc.Component {

    // LIFE-CYCLE CALLBACKS:

    onLoad() {
        // cc.macro.ENABLE_MULTI_TOUCH = false;
    }

    start() {
        let arr = [];
        for (let index = 0; index < 56; index++) {
            cc.loader.loadRes('content', cc.SpriteFrame, (err: Error, res: cc.Asset) => {
                if (!err) {
                    res.addRef();
                    arr.push(res);
                }
            })
            cc.loader.loadRes('test', cc.SpriteFrame, (err: Error, res: cc.Asset) => {
                if (!err) {
                    arr.push(res);

                }
            })
            cc.loader.loadRes('cocos_creator', cc.SpriteFrame, (err: Error, res: cc.Asset) => {
                if (!err) {

                    arr.push(res);
                }
            })
            cc.loader.loadRes('cocos_creator_white', cc.SpriteFrame, (err: Error, res: cc.Asset) => {
                if (!err) {
                    arr.push(res);
                }
            })
            cc.loader.loadRes('spineboy/spineboy', sp.SkeletonData, (err: Error, res: cc.Asset) => {
                if (!err) {
                    arr.push(res);
                }
            })
            cc.loader.loadRes('spineRaptor/spineRaptor', sp.SkeletonData, (err: Error, res: cc.Asset) => {
                if (!err) {
                    arr.push(res);
                }
            })

        }

        console.log('length: ',arr.length)
    }

    // update (dt) {}
}
