引导系统基本完成,开始制作 引导步骤

This commit is contained in:
2025-08-24 23:40:37 +08:00
parent d693499397
commit 6a29821a7b
46 changed files with 11593 additions and 8594 deletions

View File

@@ -6,24 +6,40 @@ 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';
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()
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)
}
update(deltaTime: number) {
}
update_data(uuid:number){
this.h_uuid=uuid
let hero_data = HeroInfo[uuid]
console.log("[HInfoComp]:update_data",uuid,hero_data,this.node)
@@ -90,7 +106,8 @@ export class HInfoComp extends Component {
}
oops.gui.toast("英雄< "+HeroInfo[this.h_uuid].name+" >解锁成功")
this.update_data(this.h_uuid)
oops.message.dispatchEvent(GameEvent.UpdateHero, {uuid:this.h_uuid})
oops.message.dispatchEvent(GameEvent.GuideEnd,GuideConfig[3].key)
oops.message.dispatchEvent(GameEvent.HeroUnlock, {uuid:this.h_uuid})
}
uplevel(){
let lv=smc.heros[this.h_uuid].lv
@@ -111,8 +128,7 @@ export class HInfoComp extends Component {
}
this.update_data(this.h_uuid)
oops.gui.toast(`英雄< ${HeroInfo[this.h_uuid].name} >升级成功`)
oops.message.dispatchEvent(GameEvent.UpdateHero, {uuid:this.h_uuid})
oops.message.dispatchEvent(GameEvent.HeroLvUp, {uuid:this.h_uuid})
}
next_hero(){
let heros=getHeroList()