const { ccclass, property } = cc._decorator;

@ccclass
export default class Helloworld extends cc.Component {

    @property(cc.Label)
    label: cc.Label = null;

    @property
    text: string = 'hello';

    start() {
        // init logic
        this.label.string = this.text;
        this._testLoad();
    }

    /**测试 */
    private _testLoad(): void {
        cc.loader.load("https://static.361mogame.com/game-static/g19/Debug/hero_11.json", (err, res) => {
            if (err) {
                console.log("测试加载报错", JSON.stringify(err))
                this.label.string  = "加载失败"
            } else {
                console.log("加载成功", res);
                this.label.string  = "加载成功"
            }

        })
    }
}
