引导 基本完成

This commit is contained in:
2025-08-25 17:28:02 +08:00
parent 6a29821a7b
commit 6c95b3acc3
17 changed files with 1085 additions and 508 deletions

View File

@@ -15,12 +15,18 @@ export enum GuideStepType {
WAIT = "wait",
}
export const finishCurrGuide=(key:number)=>{
if(smc.guides[key]==0){
if(key==0){
oops.message.dispatchEvent(GameEvent.GuideEnd,key)
}else{
if(smc.guides[key-1]===1&&smc.guides[key]===0){
oops.message.dispatchEvent(GameEvent.GuideEnd,key)
}
}
}
export const startGuide=(key:number)=>{
if(smc.guides[key-1]==1&&smc.guides[key]==0){
if(smc.guides[key-1]===1&&smc.guides[key]===0){
oops.message.dispatchEvent(GameEvent.GuideStart,key)
}
}
@@ -33,6 +39,7 @@ export interface IGuideStep {
/** 目标节点路径(用于查找目标节点) */
key: number;
targetPath?: string;
tipParent?: string;
/** 提示文本 */
tipText?: string;
/** 提示文本偏移 */
@@ -61,8 +68,9 @@ export const GuideConfig: { [key: number]: IGuideStep } = {
id: "welcome", type: GuideStepType.WAIT,key:0,
targetPath: "root/gui/LayerUI/role_controller/mission_home/start/name",
tipText: "欢迎来到游戏",
handOffset: { x: 42, y: -45 }, tipOffset: { x: 0, y: 200 },
nextStep: "start_battle", end_event: "click", noInput: true,
handOffset: { x: 42, y: -45 }, tipOffset: { x: 0, y: 600 },
nextStep: "start_battle", waitTime: 2, end_event: "click", noInput: true,
},
1: {
id: "start_battle", type: GuideStepType.CLICK,key:1,
@@ -74,30 +82,65 @@ export const GuideConfig: { [key: number]: IGuideStep } = {
2: {
id: "hero_page", type: GuideStepType.CLICK,key:2,
// 使用相对路径,从场景根节点开始查找
targetPath: "root/gui/LayerUI/role_controller/mission_home/hero_page",
targetPath: "root/gui/LayerUI/role_controller/mission_home/btns/heros",
tipText: "去招募更多英雄增强队伍吧",
handOffset: { x: 42, y: -45 }, // 向上偏移50像素避免遮挡
handOffset: { x: 42, y: -45 }, tipOffset: { x: 0, y: 200 },
},
3: {
id: "hero_info", type: GuideStepType.CLICK,key:3,
id: "to_hero_info", type: GuideStepType.CLICK,key:3,
// 使用相对路径,从场景根节点开始查找
targetPath: "root/gui/LayerUI/role_controller/mission_home/hero_page",
targetPath: "root/gui/LayerUI/role_controller/mission_home/heros_page",
tipText: "选择可以解锁的英雄吧",
handOffset: { x: 42, y: -45 }, // 向上偏移50像素避免遮挡
handOffset: { x: 42, y: -45 }, tipOffset: { x: 0, y: 200 } // 向上偏移50像素避免遮挡
},
4: {
id: "re_battle", type: GuideStepType.CLICK,key:4,
id: "do_hero_info", type: GuideStepType.CLICK,key:4,
// 使用相对路径,从场景根节点开始查找
targetPath: "root/gui/LayerUI/hero_select/main/view/heros/hero2",
tipText: "点击这里选择你的第一个英雄",
handOffset: { x: 42, y: -45 }, // 向上偏移50像素避免遮挡
targetPath: "root/gui/LayerUI/Hinfo/unLock",
tipText: "招募这个英雄",
handOffset: { x: 42, y: -45 }, tipOffset: { x: 0, y: 200 }// 向上偏移50像素避免遮挡
},
5: {
id: "up_lv_hero", type: GuideStepType.CLICK,key:5,
// 使用相对路径,从场景根节点开始查找
targetPath: "root/gui/LayerUI/Hinfo/upBtn",
tipText: "升级强化这个英雄",
handOffset: { x: 42, y: -45 },tipOffset: { x: 0, y: 200 } // 向上偏移50像素避免遮挡
},
6: {
id: "close_hinfo", type: GuideStepType.CLICK,key:6,
// 使用相对路径,从场景根节点开始查找
targetPath: "root/gui/LayerUI/Hinfo/back",
tipText: "返回",
handOffset: { x: 42, y: -45 },tipOffset: { x: 0, y: 200 } // 向上偏移50像素避免遮挡
},
7: {
id: "to_mission", type: GuideStepType.CLICK,key:7,
// 使用相对路径,从场景根节点开始查找
targetPath: "root/gui/LayerUI/role_controller/mission_home/btns/fight",
tipText: "再次进入战斗",
handOffset: { x: 42, y: -45 }, tipOffset: { x: 0, y: 200 },
},
8: {
id: "to_add_hero", type: GuideStepType.CLICK,key:8,
// 使用相对路径,从场景根节点开始查找
targetPath: "root/gui/LayerUI/role_controller/mission_home/readyheros/hero3",
tipText: "添加上阵英雄",
handOffset: { x: 42, y: -45 }, tipOffset: { x: 0, y: 200 },
},
9: {
id: "to_hero_select", type: GuideStepType.CLICK,key:9,
// 使用相对路径,从场景根节点开始查找
targetPath: "root/gui/LayerUI/hero_select/main/view/heros/hero2",
tipText: "点击这里选择你的第一个英雄",
handOffset: { x: 42, y: -45 }, // 向上偏移50像素避免遮挡
tipText: "选择英雄",
handOffset: { x: 42, y: -45 }, tipOffset: { x: 0, y: 200 },
},
10: {
id: "start_battle", type: GuideStepType.CLICK,key:10,
targetPath: "root/gui/LayerUI/role_controller/mission_home/start/name",
tipText: "享受你的游戏!",
handOffset: { x: 42, y: -45 }, tipOffset: { x: 0, y: 200 },
// 42 45是手指的偏移量 0 0是提示的偏移量
},
};