开始商店 脚本和ui
This commit is contained in:
26
assets/script/game/map/ShopPageComp.ts
Normal file
26
assets/script/game/map/ShopPageComp.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
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])
|
||||
}
|
||||
}
|
||||
update(deltaTime: number) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user