//臘鴨官方api不詳細系列之ui預制體

// 創建預制體文件,隨便拖一個場景中的預制體到 Assets的任意文件夾中,要規范的話則放在Prefab中

// 上一步操作完后就可以在文件夾中看到.prefab文件了

// 雙擊該.prefab文件如下圖所示,然后按F12鍵 保存導出

 

 // 如下圖,可以看到bin文件目錄下的prefab文件夾離會多一個和上面prefab文件同名的.json文件

 

 

 

// 然后添加預制體,操作完成

Laya.loader.create("prefab/changeView.json", Laya.Handler.create(this, function(){
            this.cellView = Laya.loader.getRes("prefab/changeView.json");
            this.cell = new Laya.View();
            this.cell.createView(cellView);
            this.addChild(this.cell);
        }));