
import { _decorator, Component, Node, assetManager, director } from 'cc';
const { ccclass, property } = _decorator;

/**
 * Predefined variables
 * Name = Load
 * DateTime = Thu Oct 28 2021 10:37:43 GMT+0800 (中国标准时间)
 * Author = gxz0a0q0
 * FileBasename = load.ts
 * FileBasenameNoExtension = load
 * URL = db://assets/load.ts
 * ManualUrl = https://docs.cocos.com/creator/3.3/manual/zh/
 *
 */
 
@ccclass('Load')
export class Load extends Component {
    // [1]
    // dummy = '';

    // [2]
    // @property
    // serializableDummy = 0;

    start () {
        assetManager.loadBundle(jsb.fileUtils.getWritablePath()+'game/testbundle',(err,bundle)=>{
            console.log(bundle.name);
            bundle.loadScene('bundleScene',(err,scene)=>{
                director.runScene(scene);
            });
        })
    }

    // update (deltaTime: number) {
    //     // [4]
    // }
}

/**
 * [1] Class member could be defined like this.
 * [2] Use `property` decorator if your want the member to be serializable.
 * [3] Your initialization goes here.
 * [4] Your update function goes here.
 *
 * Learn more about scripting: https://docs.cocos.com/creator/3.3/manual/zh/scripting/
 * Learn more about CCClass: https://docs.cocos.com/creator/3.3/manual/zh/scripting/ccclass.html
 * Learn more about life-cycle callbacks: https://docs.cocos.com/creator/3.3/manual/zh/scripting/life-cycle-callbacks.html
 */
