27 lines
714 B
TypeScript
27 lines
714 B
TypeScript
import { _decorator, Component, Node } from 'cc';
|
|
import { GoodsComp } from './GoodsComp';
|
|
const { ccclass, property } = _decorator;
|
|
|
|
@ccclass('ShopPageComp')
|
|
export class ShopPageComp extends Component {
|
|
daily_goods:any[]=[1001,1002,1004,1006]
|
|
weekly_goods:any[]=[]
|
|
monthly_goods:any[]=[]
|
|
special_goods:any[]=[]
|
|
start() {
|
|
this.update_daily_goods()
|
|
}
|
|
update_daily_goods(){
|
|
let items=this.node.getChildByName("daily").getChildByName("items").children
|
|
for(let i=0;i<items.length;i++){
|
|
let goods=items[i]
|
|
goods.getComponent(GoodsComp).update_data(this.daily_goods[i],i)
|
|
}
|
|
}
|
|
update(deltaTime: number) {
|
|
|
|
}
|
|
}
|
|
|
|
|