引导 基本完成
This commit is contained in:
@@ -6,35 +6,19 @@ import { smc } from '../common/SingletonModuleComp';
|
||||
import { GameEvent } from '../common/config/GameEvent';
|
||||
import { NumberFormatter } from '../common/config/BoxSet';
|
||||
import { Items } from '../common/config/Items';
|
||||
import { finishCurrGuide, GuideConfig } from '../common/config/Guide';
|
||||
import { finishCurrGuide, GuideConfig, startGuide } from '../common/config/Guide';
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass('HInfoComp')
|
||||
export class HInfoComp extends Component {
|
||||
h_uuid:number=0
|
||||
private guides:any=[0,1]
|
||||
private guideends:any=[3,5]
|
||||
start() {
|
||||
|
||||
}
|
||||
|
||||
onAdded(args: any) {
|
||||
// console.log("[HInfoComp]:onAdded",args)
|
||||
this.endGuide()
|
||||
this.startNextGuide()
|
||||
console.log("[HInfoComp]:onAdded",this.node)
|
||||
this.update_data(args)
|
||||
}
|
||||
startNextGuide(){
|
||||
this.guides.forEach(guide_key=>{
|
||||
if(smc.guides[guide_key]==0){
|
||||
console.log("[HInfoComp]:推送启动引导:key",guide_key)
|
||||
oops.message.dispatchEvent(GameEvent.GuideStart, guide_key)
|
||||
return
|
||||
}
|
||||
})
|
||||
}
|
||||
endGuide(){
|
||||
finishCurrGuide(3)
|
||||
startGuide(5)
|
||||
}
|
||||
update(deltaTime: number) {
|
||||
|
||||
@@ -74,6 +58,12 @@ export class HInfoComp extends Component {
|
||||
need_node.getChildByName("gold").getChildByName("has").getComponent(Label).string=NumberFormatter.formatNumber(smc.data.gold)
|
||||
}
|
||||
show_lock(lv:number){
|
||||
|
||||
if(lv==0){
|
||||
console.log("[HInfoComp]:show_lock lv==0",this.node)
|
||||
finishCurrGuide(3)
|
||||
startGuide(4)
|
||||
}
|
||||
this.node.getChildByName("upBtn").active=lv > 0
|
||||
this.node.getChildByName("upNeed").active=lv > 0
|
||||
this.node.getChildByName("lock").active=lv == 0
|
||||
@@ -105,8 +95,9 @@ export class HInfoComp extends Component {
|
||||
return
|
||||
}
|
||||
oops.gui.toast("英雄< "+HeroInfo[this.h_uuid].name+" >解锁成功")
|
||||
finishCurrGuide(4)
|
||||
startGuide(5)
|
||||
this.update_data(this.h_uuid)
|
||||
oops.message.dispatchEvent(GameEvent.GuideEnd,GuideConfig[3].key)
|
||||
oops.message.dispatchEvent(GameEvent.HeroUnlock, {uuid:this.h_uuid})
|
||||
}
|
||||
uplevel(){
|
||||
@@ -127,6 +118,8 @@ export class HInfoComp extends Component {
|
||||
return
|
||||
}
|
||||
this.update_data(this.h_uuid)
|
||||
finishCurrGuide(5)
|
||||
startGuide(6)
|
||||
oops.gui.toast(`英雄< ${HeroInfo[this.h_uuid].name} >升级成功`)
|
||||
oops.message.dispatchEvent(GameEvent.HeroLvUp, {uuid:this.h_uuid})
|
||||
}
|
||||
@@ -147,6 +140,8 @@ export class HInfoComp extends Component {
|
||||
this.update_data(prevHero)
|
||||
}
|
||||
close(){
|
||||
finishCurrGuide(6)
|
||||
startGuide(7)
|
||||
oops.gui.removeByNode(this.node)
|
||||
}
|
||||
reset() {
|
||||
|
||||
Reference in New Issue
Block a user