feat(guide): 新增新手引导相关组件与配置

1.  新增SingletonModuleComp中的已完成引导记录数组finish_guides
2.  创建GuideComp引导组件基础框架
3.  在角色控制器预制体中添加引导节点与手势图标节点
4.  新增guide和GuideComp相关的meta配置文件
This commit is contained in:
pan
2026-06-11 15:35:14 +08:00
parent 3168835fdb
commit 193beb0d24
5 changed files with 410 additions and 50 deletions

View File

@@ -22,26 +22,26 @@
"__id__": 2 "__id__": 2
}, },
{ {
"__id__": 423 "__id__": 437
}, },
{ {
"__id__": 432 "__id__": 446
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 445 "__id__": 459
}, },
{ {
"__id__": 447 "__id__": 461
}, },
{ {
"__id__": 449 "__id__": 463
} }
], ],
"_prefab": { "_prefab": {
"__id__": 451 "__id__": 465
}, },
"_lpos": { "_lpos": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
@@ -92,22 +92,25 @@
}, },
{ {
"__id__": 73 "__id__": 73
},
{
"__id__": 416
} }
], ],
"_active": true, "_active": true,
"_components": [ "_components": [
{ {
"__id__": 416 "__id__": 430
}, },
{ {
"__id__": 418 "__id__": 432
}, },
{ {
"__id__": 420 "__id__": 434
} }
], ],
"_prefab": { "_prefab": {
"__id__": 422 "__id__": 436
}, },
"_lpos": { "_lpos": {
"__type__": "cc.Vec3", "__type__": "cc.Vec3",
@@ -9418,6 +9421,297 @@
"targetOverrides": null, "targetOverrides": null,
"nestedPrefabInstanceRoots": null "nestedPrefabInstanceRoots": null
}, },
{
"__type__": "cc.Node",
"_name": "guide",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 2
},
"_children": [
{
"__id__": 417
}
],
"_active": true,
"_components": [
{
"__id__": 423
},
{
"__id__": 425
},
{
"__id__": 427
}
],
"_prefab": {
"__id__": 429
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 640,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_mobility": 0,
"_layer": 1073741824,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.Node",
"_name": "hand",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 416
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 418
},
{
"__id__": 420
}
],
"_prefab": {
"__id__": 422
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 36.036,
"y": -354.417,
"z": 0
},
"_lrot": {
"__type__": "cc.Quat",
"x": 0,
"y": 0,
"z": 0,
"w": 1
},
"_lscale": {
"__type__": "cc.Vec3",
"x": 1,
"y": 1,
"z": 1
},
"_mobility": 0,
"_layer": 1073741824,
"_euler": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_id": ""
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 417
},
"_enabled": true,
"__prefab": {
"__id__": 419
},
"_contentSize": {
"__type__": "cc.Size",
"width": 98,
"height": 111
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "79Vu4Cv05PnJw1LXaSE4DD"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 417
},
"_enabled": true,
"__prefab": {
"__id__": 421
},
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_spriteFrame": {
"__uuid__": "6165ffc9-a838-4a33-b569-bdbaaab0e6b4@5990a",
"__expectedType__": "cc.SpriteFrame"
},
"_type": 0,
"_fillType": 0,
"_sizeMode": 1,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_useGrayscale": false,
"_atlas": null,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "e4qJ7s1yxD9JrYdfGLFkVo"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "c98HTacPpLKZkCGXoKpM4T",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.UITransform",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 416
},
"_enabled": true,
"__prefab": {
"__id__": 424
},
"_contentSize": {
"__type__": "cc.Size",
"width": 720,
"height": 1280
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "50NXlbXx9PHYhb8LT2nDRv"
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 416
},
"_enabled": true,
"__prefab": {
"__id__": 426
},
"_alignFlags": 45,
"_target": null,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_horizontalCenter": 0,
"_verticalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 100,
"_originalHeight": 100,
"_alignMode": 2,
"_lockFlags": 0,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "10DsksGxZDUbKjtrjCTMxF"
},
{
"__type__": "25122z/cnRPhp90+CJYs5+r",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 416
},
"_enabled": true,
"__prefab": {
"__id__": 428
},
"hand": {
"__id__": 417
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "1fYnYBrbBNgoLyArRX18hs"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "6dh4o/8p1Cy5An1p6o4Bc3",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{ {
"__type__": "cc.UITransform", "__type__": "cc.UITransform",
"_name": "", "_name": "",
@@ -9428,7 +9722,7 @@
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 417 "__id__": 431
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
@@ -9456,7 +9750,7 @@
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 419 "__id__": 433
}, },
"_alignFlags": 21, "_alignFlags": 21,
"_target": null, "_target": null,
@@ -9492,7 +9786,7 @@
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 421 "__id__": 435
}, },
"home_btn": { "home_btn": {
"__id__": 121 "__id__": 121
@@ -9541,14 +9835,14 @@
"__id__": 1 "__id__": 1
}, },
"_prefab": { "_prefab": {
"__id__": 424 "__id__": 438
}, },
"__editorExtras__": {} "__editorExtras__": {}
}, },
{ {
"__type__": "cc.PrefabInfo", "__type__": "cc.PrefabInfo",
"root": { "root": {
"__id__": 423 "__id__": 437
}, },
"asset": { "asset": {
"__uuid__": "26bff847-cd29-48a5-bbfa-c3e2dbda688d", "__uuid__": "26bff847-cd29-48a5-bbfa-c3e2dbda688d",
@@ -9556,7 +9850,7 @@
}, },
"fileId": "5a9CMsVQhKP5Y+UJfTKPbx", "fileId": "5a9CMsVQhKP5Y+UJfTKPbx",
"instance": { "instance": {
"__id__": 425 "__id__": 439
}, },
"targetOverrides": null "targetOverrides": null
}, },
@@ -9570,19 +9864,19 @@
"mountedComponents": [], "mountedComponents": [],
"propertyOverrides": [ "propertyOverrides": [
{ {
"__id__": 426 "__id__": 440
}, },
{ {
"__id__": 428 "__id__": 442
}, },
{ {
"__id__": 429 "__id__": 443
}, },
{ {
"__id__": 430 "__id__": 444
}, },
{ {
"__id__": 431 "__id__": 445
} }
], ],
"removedComponents": [] "removedComponents": []
@@ -9590,7 +9884,7 @@
{ {
"__type__": "CCPropertyOverrideInfo", "__type__": "CCPropertyOverrideInfo",
"targetInfo": { "targetInfo": {
"__id__": 427 "__id__": 441
}, },
"propertyPath": [ "propertyPath": [
"_name" "_name"
@@ -9606,7 +9900,7 @@
{ {
"__type__": "CCPropertyOverrideInfo", "__type__": "CCPropertyOverrideInfo",
"targetInfo": { "targetInfo": {
"__id__": 427 "__id__": 441
}, },
"propertyPath": [ "propertyPath": [
"_lpos" "_lpos"
@@ -9621,7 +9915,7 @@
{ {
"__type__": "CCPropertyOverrideInfo", "__type__": "CCPropertyOverrideInfo",
"targetInfo": { "targetInfo": {
"__id__": 427 "__id__": 441
}, },
"propertyPath": [ "propertyPath": [
"_lrot" "_lrot"
@@ -9637,7 +9931,7 @@
{ {
"__type__": "CCPropertyOverrideInfo", "__type__": "CCPropertyOverrideInfo",
"targetInfo": { "targetInfo": {
"__id__": 427 "__id__": 441
}, },
"propertyPath": [ "propertyPath": [
"_euler" "_euler"
@@ -9652,7 +9946,7 @@
{ {
"__type__": "CCPropertyOverrideInfo", "__type__": "CCPropertyOverrideInfo",
"targetInfo": { "targetInfo": {
"__id__": 427 "__id__": 441
}, },
"propertyPath": [ "propertyPath": [
"_active" "_active"
@@ -9666,14 +9960,14 @@
"__id__": 1 "__id__": 1
}, },
"_prefab": { "_prefab": {
"__id__": 433 "__id__": 447
}, },
"__editorExtras__": {} "__editorExtras__": {}
}, },
{ {
"__type__": "cc.PrefabInfo", "__type__": "cc.PrefabInfo",
"root": { "root": {
"__id__": 432 "__id__": 446
}, },
"asset": { "asset": {
"__uuid__": "56aee962-4a5e-45ae-a779-999444d06d18", "__uuid__": "56aee962-4a5e-45ae-a779-999444d06d18",
@@ -9681,7 +9975,7 @@
}, },
"fileId": "cboM54s0hM07XCtrpFp0/b", "fileId": "cboM54s0hM07XCtrpFp0/b",
"instance": { "instance": {
"__id__": 434 "__id__": 448
}, },
"targetOverrides": null "targetOverrides": null
}, },
@@ -9695,28 +9989,28 @@
"mountedComponents": [], "mountedComponents": [],
"propertyOverrides": [ "propertyOverrides": [
{ {
"__id__": 435 "__id__": 449
}, },
{ {
"__id__": 437 "__id__": 451
}, },
{ {
"__id__": 438 "__id__": 452
}, },
{ {
"__id__": 439 "__id__": 453
}, },
{ {
"__id__": 440 "__id__": 454
}, },
{ {
"__id__": 442 "__id__": 456
}, },
{ {
"__id__": 443 "__id__": 457
}, },
{ {
"__id__": 444 "__id__": 458
} }
], ],
"removedComponents": [] "removedComponents": []
@@ -9724,7 +10018,7 @@
{ {
"__type__": "CCPropertyOverrideInfo", "__type__": "CCPropertyOverrideInfo",
"targetInfo": { "targetInfo": {
"__id__": 436 "__id__": 450
}, },
"propertyPath": [ "propertyPath": [
"_name" "_name"
@@ -9740,7 +10034,7 @@
{ {
"__type__": "CCPropertyOverrideInfo", "__type__": "CCPropertyOverrideInfo",
"targetInfo": { "targetInfo": {
"__id__": 436 "__id__": 450
}, },
"propertyPath": [ "propertyPath": [
"_lpos" "_lpos"
@@ -9755,7 +10049,7 @@
{ {
"__type__": "CCPropertyOverrideInfo", "__type__": "CCPropertyOverrideInfo",
"targetInfo": { "targetInfo": {
"__id__": 436 "__id__": 450
}, },
"propertyPath": [ "propertyPath": [
"_lrot" "_lrot"
@@ -9771,7 +10065,7 @@
{ {
"__type__": "CCPropertyOverrideInfo", "__type__": "CCPropertyOverrideInfo",
"targetInfo": { "targetInfo": {
"__id__": 436 "__id__": 450
}, },
"propertyPath": [ "propertyPath": [
"_euler" "_euler"
@@ -9786,7 +10080,7 @@
{ {
"__type__": "CCPropertyOverrideInfo", "__type__": "CCPropertyOverrideInfo",
"targetInfo": { "targetInfo": {
"__id__": 441 "__id__": 455
}, },
"propertyPath": [ "propertyPath": [
"_top" "_top"
@@ -9802,7 +10096,7 @@
{ {
"__type__": "CCPropertyOverrideInfo", "__type__": "CCPropertyOverrideInfo",
"targetInfo": { "targetInfo": {
"__id__": 441 "__id__": 455
}, },
"propertyPath": [ "propertyPath": [
"_alignFlags" "_alignFlags"
@@ -9812,7 +10106,7 @@
{ {
"__type__": "CCPropertyOverrideInfo", "__type__": "CCPropertyOverrideInfo",
"targetInfo": { "targetInfo": {
"__id__": 441 "__id__": 455
}, },
"propertyPath": [ "propertyPath": [
"_bottom" "_bottom"
@@ -9822,7 +10116,7 @@
{ {
"__type__": "CCPropertyOverrideInfo", "__type__": "CCPropertyOverrideInfo",
"targetInfo": { "targetInfo": {
"__id__": 436 "__id__": 450
}, },
"propertyPath": [ "propertyPath": [
"_active" "_active"
@@ -9839,7 +10133,7 @@
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 446 "__id__": 460
}, },
"_contentSize": { "_contentSize": {
"__type__": "cc.Size", "__type__": "cc.Size",
@@ -9867,7 +10161,7 @@
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 448 "__id__": 462
}, },
"_alignFlags": 45, "_alignFlags": 45,
"_target": null, "_target": null,
@@ -9903,7 +10197,7 @@
}, },
"_enabled": true, "_enabled": true,
"__prefab": { "__prefab": {
"__id__": 450 "__id__": 464
}, },
"debugMode": false, "debugMode": false,
"_id": "" "_id": ""
@@ -9925,10 +10219,10 @@
"targetOverrides": null, "targetOverrides": null,
"nestedPrefabInstanceRoots": [ "nestedPrefabInstanceRoots": [
{ {
"__id__": 432 "__id__": 446
}, },
{ {
"__id__": 423 "__id__": 437
}, },
{ {
"__id__": 55 "__id__": 55

View File

@@ -44,6 +44,7 @@ export class SingletonModuleComp extends ecs.Comp {
in_fight: false, in_fight: false,
stop_mon_action: false, stop_mon_action: false,
}; };
finish_guides: number[] = []
data: any = { data: any = {
score: 0, score: 0,
mission: 1, mission: 1,

View File

@@ -0,0 +1,9 @@
{
"ver": "1.2.0",
"importer": "directory",
"imported": true,
"uuid": "80f55ba3-1e7d-4b39-a7ea-d896f819edb6",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@@ -0,0 +1,47 @@
import { mLogger } from "../common/Logger";
import { _decorator, Animation, AnimationClip, EventTouch, Label, Node, NodeEventType, Sprite, SpriteAtlas, Tween, tween, UIOpacity, Vec3, resources, Light, UITransform, Widget, CCInteger } from "cc";
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
const { ccclass, property } = _decorator;
@ccclass('GuideComp')
@ecs.register('GuideComp', false)
export class GuideComp extends CCComp {
/** 是否开启调试日志 */
private debugMode: boolean = true;
// ======================== 编辑器绑定节点 ========================
/** 手势图标节点 */
@property(Node)
hand: Node = null!
/** 手势图标节点 */
@property({ type: CCInteger })
guide_id: number = 0
onLoad() {
}
/** 组件销毁时解绑所有事件,防止残留回调 */
onDestroy() {
}
/** 外部初始化入口(由 MissionGuideComp 调用) */
init() {
}
/** ECS 组件移除时的释放钩子:销毁节点 */
reset() {
this.node.destroy();
}
}

View File

@@ -0,0 +1,9 @@
{
"ver": "4.0.24",
"importer": "typescript",
"imported": true,
"uuid": "25122cff-7274-4f86-9f74-f82258b39fab",
"files": [],
"subMetas": {},
"userData": {}
}