咸鱼的反击
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
xianyudefanji/assets/Scripts/BaiCaoJi/BaiCaoJiShuoMing.ts

55 lines
1.9 KiB

import Common5 from "../../Platform/th/Common5";
import { BagGoodsConfig } from "../Manager/BagManager";
import BaiCaoJiManager from "../Manager/BaiCaoJiManager";
const {ccclass, property} = cc._decorator;
@ccclass
export default class BaiCaoJiShuoMing extends cc.Component {
@property(cc.Node)
scrollViewContent: cc.Node = null;
@property(cc.Node)
childItem: cc.Node = null;
// LIFE-CYCLE CALLBACKS:
// onLoad () {}
start () {
this.initView()
}
initView(){
let config = BaiCaoJiManager.getManagerConfigs()
for(let i=0;i<config.length;i++){
let item = cc.instantiate(this.childItem)
Common5.addUrlSprite_custom('BaiCaoJi/佰草集花/'+config[i].goodName, item.getChildByName('iconSpr').getComponent(cc.Sprite))
item.getChildByName('nameStr').getComponent(cc.Label).string = config[i].goodName
item.active = true
this.scrollViewContent.addChild(item)
}
//暂不需要
// for(let i=0;i<BagGoodsConfig.length;i++){
// if(BagGoodsConfig[i].GMGameType == 'BaiCaoJi'){
// let item = cc.instantiate(this.childItem)
// //Common5.getSpriteFrameFromBundle("GameRes", 'BaiCaoJi/texture/佰草集花/'+BagGoodsConfig[i].goodName , item.getChildByName('iconSpr').getComponent(cc.Sprite));
// Common5.addUrlSprite_custom('BaiCaoJi/佰草集花/'+BagGoodsConfig[i].goodName, item.getChildByName('iconSpr').getComponent(cc.Sprite))
// item.getChildByName('nameStr').getComponent(cc.Label).string = BagGoodsConfig[i].goodName
// item.active = true
// this.scrollViewContent.addChild(item)
// }
// }
}
onBtnClose(){
this.node.removeFromParent()
this.node.destroy()
}
// update (dt) {}
}