环境技能继续

This commit is contained in:
2024-12-11 10:54:40 +08:00
parent 4ef7abf374
commit ec83f6506b
14 changed files with 4822 additions and 5396 deletions

View File

@@ -1,7 +1,7 @@
[
{
"__type__": "cc.Prefab",
"_name": "skill_card",
"_name": "MSCard",
"_objFlags": 0,
"__editorExtras__": {},
"_native": "",
@@ -13,7 +13,7 @@
},
{
"__type__": "cc.Node",
"_name": "skill_card",
"_name": "MSCard",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": null,
@@ -24,6 +24,9 @@
{
"__id__": 8
},
{
"__id__": 20
},
{
"__id__": 26
},
@@ -37,35 +40,32 @@
"__id__": 44
},
{
"__id__": 50
"__id__": 59
},
{
"__id__": 65
"__id__": 73
},
{
"__id__": 79
"__id__": 88
},
{
"__id__": 94
},
{
"__id__": 100
},
{
"__id__": 106
}
],
"_active": true,
"_components": [
{
"__id__": 112
"__id__": 106
},
{
"__id__": 114
"__id__": 108
}
],
"_prefab": {
"__id__": 116
"__id__": 110
},
"_lpos": {
"__type__": "cc.Vec3",
@@ -234,7 +234,7 @@
},
{
"__type__": "cc.Node",
"_name": "icon_bg",
"_name": "skill",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
@@ -243,22 +243,19 @@
"_children": [
{
"__id__": 9
},
{
"__id__": 15
}
],
"_active": true,
"_components": [
{
"__id__": 21
"__id__": 15
},
{
"__id__": 23
"__id__": 17
}
],
"_prefab": {
"__id__": 25
"__id__": 19
},
"_lpos": {
"__type__": "cc.Vec3",
@@ -425,142 +422,6 @@
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.Node",
"_name": "icon-001",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 8
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 16
},
{
"__id__": 18
}
],
"_prefab": {
"__id__": 20
},
"_lpos": {
"__type__": "cc.Vec3",
"x": 0,
"y": 8.17,
"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__": 15
},
"_enabled": true,
"__prefab": {
"__id__": 17
},
"_contentSize": {
"__type__": "cc.Size",
"width": 45,
"height": 45
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "39qXkY+OBEOpQ+hWpYTNWl"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 15
},
"_enabled": true,
"__prefab": {
"__id__": 19
},
"_customMaterial": null,
"_srcBlendFactor": 2,
"_dstBlendFactor": 4,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_spriteFrame": {
"__uuid__": "8e53e122-d71b-440a-bb07-9938dd6c20d9@b6419",
"__expectedType__": "cc.SpriteFrame"
},
"_type": 0,
"_fillType": 0,
"_sizeMode": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_useGrayscale": false,
"_atlas": null,
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "edCu4psU5MXpLla2YKZMcK"
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__id__": 0
},
"fileId": "48YOCiSJRL463LhrQ7wX+a",
"instance": null,
"targetOverrides": null,
"nestedPrefabInstanceRoots": null
},
{
"__type__": "cc.UITransform",
"_name": "",
@@ -571,7 +432,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 22
"__id__": 16
},
"_contentSize": {
"__type__": "cc.Size",
@@ -599,7 +460,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 24
"__id__": 18
},
"_customMaterial": null,
"_srcBlendFactor": 2,
@@ -659,14 +520,14 @@
"_active": true,
"_components": [
{
"__id__": 27
"__id__": 21
},
{
"__id__": 29
"__id__": 23
}
],
"_prefab": {
"__id__": 31
"__id__": 25
},
"_lpos": {
"__type__": "cc.Vec3",
@@ -703,11 +564,11 @@
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 26
"__id__": 20
},
"_enabled": true,
"__prefab": {
"__id__": 28
"__id__": 22
},
"_contentSize": {
"__type__": "cc.Size",
@@ -731,11 +592,11 @@
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 26
"__id__": 20
},
"_enabled": true,
"__prefab": {
"__id__": 30
"__id__": 24
},
"_customMaterial": null,
"_srcBlendFactor": 2,
@@ -808,7 +669,7 @@
},
{
"__type__": "cc.Node",
"_name": "bg",
"_name": "ibg",
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
@@ -818,14 +679,14 @@
"_active": true,
"_components": [
{
"__id__": 33
"__id__": 27
},
{
"__id__": 35
"__id__": 29
}
],
"_prefab": {
"__id__": 37
"__id__": 31
},
"_lpos": {
"__type__": "cc.Vec3",
@@ -862,11 +723,11 @@
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 32
"__id__": 26
},
"_enabled": true,
"__prefab": {
"__id__": 34
"__id__": 28
},
"_contentSize": {
"__type__": "cc.Size",
@@ -890,11 +751,11 @@
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 32
"__id__": 26
},
"_enabled": true,
"__prefab": {
"__id__": 36
"__id__": 30
},
"_customMaterial": null,
"_srcBlendFactor": 2,
@@ -954,14 +815,14 @@
"_active": true,
"_components": [
{
"__id__": 39
"__id__": 33
},
{
"__id__": 41
"__id__": 35
}
],
"_prefab": {
"__id__": 43
"__id__": 37
},
"_lpos": {
"__type__": "cc.Vec3",
@@ -998,11 +859,11 @@
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 38
"__id__": 32
},
"_enabled": true,
"__prefab": {
"__id__": 40
"__id__": 34
},
"_contentSize": {
"__type__": "cc.Size",
@@ -1026,11 +887,11 @@
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 38
"__id__": 32
},
"_enabled": true,
"__prefab": {
"__id__": 42
"__id__": 36
},
"_customMaterial": null,
"_srcBlendFactor": 2,
@@ -1113,14 +974,14 @@
"_active": true,
"_components": [
{
"__id__": 45
"__id__": 39
},
{
"__id__": 47
"__id__": 41
}
],
"_prefab": {
"__id__": 49
"__id__": 43
},
"_lpos": {
"__type__": "cc.Vec3",
@@ -1157,11 +1018,11 @@
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 44
"__id__": 38
},
"_enabled": true,
"__prefab": {
"__id__": 46
"__id__": 40
},
"_contentSize": {
"__type__": "cc.Size",
@@ -1185,11 +1046,11 @@
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 44
"__id__": 38
},
"_enabled": true,
"__prefab": {
"__id__": 48
"__id__": 42
},
"_customMaterial": null,
"_srcBlendFactor": 2,
@@ -1270,23 +1131,23 @@
},
"_children": [
{
"__id__": 51
"__id__": 45
}
],
"_active": true,
"_components": [
{
"__id__": 57
"__id__": 51
},
{
"__id__": 59
"__id__": 53
},
{
"__id__": 61
"__id__": 55
}
],
"_prefab": {
"__id__": 64
"__id__": 58
},
"_lpos": {
"__type__": "cc.Vec3",
@@ -1323,20 +1184,20 @@
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 50
"__id__": 44
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 52
"__id__": 46
},
{
"__id__": 54
"__id__": 48
}
],
"_prefab": {
"__id__": 56
"__id__": 50
},
"_lpos": {
"__type__": "cc.Vec3",
@@ -1373,11 +1234,11 @@
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 51
"__id__": 45
},
"_enabled": true,
"__prefab": {
"__id__": 53
"__id__": 47
},
"_contentSize": {
"__type__": "cc.Size",
@@ -1401,11 +1262,11 @@
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 51
"__id__": 45
},
"_enabled": true,
"__prefab": {
"__id__": 55
"__id__": 49
},
"_customMaterial": null,
"_srcBlendFactor": 2,
@@ -1482,11 +1343,11 @@
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 50
"__id__": 44
},
"_enabled": true,
"__prefab": {
"__id__": 58
"__id__": 52
},
"_contentSize": {
"__type__": "cc.Size",
@@ -1510,11 +1371,11 @@
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 50
"__id__": 44
},
"_enabled": true,
"__prefab": {
"__id__": 60
"__id__": 54
},
"_customMaterial": null,
"_srcBlendFactor": 2,
@@ -1555,15 +1416,15 @@
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 50
"__id__": 44
},
"_enabled": true,
"__prefab": {
"__id__": 62
"__id__": 56
},
"clickEvents": [
{
"__id__": 63
"__id__": 57
}
],
"_interactable": true,
@@ -1642,23 +1503,23 @@
},
"_children": [
{
"__id__": 66
"__id__": 60
}
],
"_active": true,
"_components": [
{
"__id__": 72
"__id__": 66
},
{
"__id__": 74
"__id__": 68
},
{
"__id__": 76
"__id__": 70
}
],
"_prefab": {
"__id__": 78
"__id__": 72
},
"_lpos": {
"__type__": "cc.Vec3",
@@ -1695,20 +1556,20 @@
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 65
"__id__": 59
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 67
"__id__": 61
},
{
"__id__": 69
"__id__": 63
}
],
"_prefab": {
"__id__": 71
"__id__": 65
},
"_lpos": {
"__type__": "cc.Vec3",
@@ -1745,11 +1606,11 @@
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 66
"__id__": 60
},
"_enabled": true,
"__prefab": {
"__id__": 68
"__id__": 62
},
"_contentSize": {
"__type__": "cc.Size",
@@ -1773,11 +1634,11 @@
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 66
"__id__": 60
},
"_enabled": true,
"__prefab": {
"__id__": 70
"__id__": 64
},
"_customMaterial": null,
"_srcBlendFactor": 2,
@@ -1854,11 +1715,11 @@
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 65
"__id__": 59
},
"_enabled": true,
"__prefab": {
"__id__": 73
"__id__": 67
},
"_contentSize": {
"__type__": "cc.Size",
@@ -1882,11 +1743,11 @@
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 65
"__id__": 59
},
"_enabled": true,
"__prefab": {
"__id__": 75
"__id__": 69
},
"_customMaterial": null,
"_srcBlendFactor": 2,
@@ -1927,11 +1788,11 @@
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 65
"__id__": 59
},
"_enabled": true,
"__prefab": {
"__id__": 77
"__id__": 71
},
"clickEvents": [],
"_interactable": false,
@@ -1971,7 +1832,7 @@
"_duration": 0.1,
"_zoomScale": 0.8,
"_target": {
"__id__": 65
"__id__": 59
},
"_id": ""
},
@@ -2002,23 +1863,23 @@
},
"_children": [
{
"__id__": 80
"__id__": 74
}
],
"_active": true,
"_components": [
{
"__id__": 86
"__id__": 80
},
{
"__id__": 88
"__id__": 82
},
{
"__id__": 90
"__id__": 84
}
],
"_prefab": {
"__id__": 93
"__id__": 87
},
"_lpos": {
"__type__": "cc.Vec3",
@@ -2055,20 +1916,20 @@
"_objFlags": 0,
"__editorExtras__": {},
"_parent": {
"__id__": 79
"__id__": 73
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 81
"__id__": 75
},
{
"__id__": 83
"__id__": 77
}
],
"_prefab": {
"__id__": 85
"__id__": 79
},
"_lpos": {
"__type__": "cc.Vec3",
@@ -2105,11 +1966,11 @@
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 80
"__id__": 74
},
"_enabled": true,
"__prefab": {
"__id__": 82
"__id__": 76
},
"_contentSize": {
"__type__": "cc.Size",
@@ -2133,11 +1994,11 @@
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 80
"__id__": 74
},
"_enabled": true,
"__prefab": {
"__id__": 84
"__id__": 78
},
"_customMaterial": null,
"_srcBlendFactor": 2,
@@ -2214,11 +2075,11 @@
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 79
"__id__": 73
},
"_enabled": true,
"__prefab": {
"__id__": 87
"__id__": 81
},
"_contentSize": {
"__type__": "cc.Size",
@@ -2242,11 +2103,11 @@
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 79
"__id__": 73
},
"_enabled": true,
"__prefab": {
"__id__": 89
"__id__": 83
},
"_customMaterial": null,
"_srcBlendFactor": 2,
@@ -2287,15 +2148,15 @@
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 79
"__id__": 73
},
"_enabled": true,
"__prefab": {
"__id__": 91
"__id__": 85
},
"clickEvents": [
{
"__id__": 92
"__id__": 86
}
],
"_interactable": true,
@@ -2335,7 +2196,7 @@
"_duration": 0.1,
"_zoomScale": 0.8,
"_target": {
"__id__": 79
"__id__": 73
},
"_id": ""
},
@@ -2378,14 +2239,14 @@
"_active": false,
"_components": [
{
"__id__": 95
"__id__": 89
},
{
"__id__": 97
"__id__": 91
}
],
"_prefab": {
"__id__": 99
"__id__": 93
},
"_lpos": {
"__type__": "cc.Vec3",
@@ -2422,11 +2283,11 @@
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 94
"__id__": 88
},
"_enabled": true,
"__prefab": {
"__id__": 96
"__id__": 90
},
"_contentSize": {
"__type__": "cc.Size",
@@ -2450,11 +2311,11 @@
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 94
"__id__": 88
},
"_enabled": true,
"__prefab": {
"__id__": 98
"__id__": 92
},
"_customMaterial": null,
"_srcBlendFactor": 2,
@@ -2514,14 +2375,14 @@
"_active": false,
"_components": [
{
"__id__": 101
"__id__": 95
},
{
"__id__": 103
"__id__": 97
}
],
"_prefab": {
"__id__": 105
"__id__": 99
},
"_lpos": {
"__type__": "cc.Vec3",
@@ -2558,11 +2419,11 @@
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 100
"__id__": 94
},
"_enabled": true,
"__prefab": {
"__id__": 102
"__id__": 96
},
"_contentSize": {
"__type__": "cc.Size",
@@ -2586,11 +2447,11 @@
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 100
"__id__": 94
},
"_enabled": true,
"__prefab": {
"__id__": 104
"__id__": 98
},
"_customMaterial": null,
"_srcBlendFactor": 2,
@@ -2650,14 +2511,14 @@
"_active": false,
"_components": [
{
"__id__": 107
"__id__": 101
},
{
"__id__": 109
"__id__": 103
}
],
"_prefab": {
"__id__": 111
"__id__": 105
},
"_lpos": {
"__type__": "cc.Vec3",
@@ -2694,11 +2555,11 @@
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 106
"__id__": 100
},
"_enabled": true,
"__prefab": {
"__id__": 108
"__id__": 102
},
"_contentSize": {
"__type__": "cc.Size",
@@ -2722,11 +2583,11 @@
"_objFlags": 0,
"__editorExtras__": {},
"node": {
"__id__": 106
"__id__": 100
},
"_enabled": true,
"__prefab": {
"__id__": 110
"__id__": 104
},
"_customMaterial": null,
"_srcBlendFactor": 2,
@@ -2807,7 +2668,7 @@
},
"_enabled": true,
"__prefab": {
"__id__": 113
"__id__": 107
},
"_contentSize": {
"__type__": "cc.Size",
@@ -2826,7 +2687,7 @@
"fileId": "15mK3HeAhJAKQvRtpGLZ72"
},
{
"__type__": "91d25u7m5BHn44btWJO5Wqu",
"__type__": "f7a30g0MchAWp+dcFVZgdYR",
"_name": "",
"_objFlags": 0,
"__editorExtras__": {},
@@ -2835,13 +2696,13 @@
},
"_enabled": true,
"__prefab": {
"__id__": 115
"__id__": 109
},
"_id": ""
},
{
"__type__": "cc.CompPrefabInfo",
"fileId": "9dv0zK5zBC/7iP2ofmKo4J"
"fileId": "3218v/X15JyJ6ZNHUYjLdL"
},
{
"__type__": "cc.PrefabInfo",

View File

@@ -8,6 +8,6 @@
],
"subMetas": {},
"userData": {
"syncNodeName": "skill_card"
"syncNodeName": "MSCard"
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -30,21 +30,19 @@ export class SingletonModuleComp extends ecs.Comp {
// {uuid:6213,type:2},{uuid:6214,type:2},{uuid:6215,type:2},
// {uuid:6216,type:2},{uuid:6217,type:2},{uuid:6218,type:2}
];
sitems:any = []
player_skills: any = [
];
player_buffs: any = [
{x:-BoxSet.CSKILL_X,y:BoxSet.CSKILL_Y,eid:0},
{x:-BoxSet.CSKILL_X+55,y:BoxSet.CSKILL_Y,eid:0},
{x:-BoxSet.CSKILL_X+110,y:BoxSet.CSKILL_Y,eid:0},
{x:-BoxSet.CSKILL_X,y:BoxSet.CSKILL_Y,eid:0},
{x:-BoxSet.CSKILL_X,y:BoxSet.CSKILL_Y+55,eid:0},
{x:-BoxSet.CSKILL_X+55,y:BoxSet.CSKILL_Y+55,eid:0},
{x:-BoxSet.CSKILL_X+110,y:BoxSet.CSKILL_Y+55,eid:0},
{x:-BoxSet.CSKILL_X+165,y:BoxSet.CSKILL_Y+55,eid:0},
];
monster_buffs: any = [];
skills: any = [
{uuid:1001,type:3,lv:0},
{uuid:1002,type:3,lv:0},
{uuid:1003,type:3,lv:0},
{uuid:1004,type:3,lv:0},
{uuid:1005,type:3,lv:0},
{uuid:1006,type:3,lv:0},
{uuid:1007,type:3,lv:0},
{uuid:1008,type:3,lv:0},
{uuid:1009,type:3,lv:0},
]
mskill=0;
/** 游戏主角 */
heros:any={
9001:{uuid:9001,lv:1,exp:0,slv:0,stone:0},
@@ -53,7 +51,6 @@ export class SingletonModuleComp extends ecs.Comp {
};
mheros:any = [];
monsters:any = [];
skills:any = []
sk_info:any = []
monsters_dead:any = []
heros_dead:any = []
@@ -131,20 +128,7 @@ export class SingletonModuleComp extends ecs.Comp {
1027:0,
1028:0,
},
talent:{
1001:{uuid:1001,lv:0,},
},
item_box:{
hp:0,
atk:0,
atk_cd:0,
power:0,
name:"",
skillcd:0,
skillsd:0,
shield:0,
info:"",
}
};
vmAdd() {
VM.add(this.vmdata, "data");

View File

@@ -32,7 +32,6 @@ export class HeroSelect extends ecs.Entity {
if(smc.heros[uuid].slv>=4) {slv.getChildByName("s4").active=true} else {slv.getChildByName("s4").active=false};
if(smc.heros[uuid].slv>=5) {slv.getChildByName("s5").active=true} else {slv.getChildByName("s5").active=false};
let hcc = node.getComponent(HeroSelectComp)!;
console.log(hcc)
hcc.h_uuid = uuid;
this.add(hcc);
}

View File

@@ -5,11 +5,9 @@ const { ccclass, property } = _decorator;
export class UiHeroComp extends Component {
h_uuid:number=0
start() {
console.log("UiHeroComp start",this.h_uuid)
console.log(this)
}
to_destroy(){
console.log("UiHeroComp to_destroy",this.h_uuid)
this.node.destroy()
}
update(deltaTime: number) {

View File

@@ -14,7 +14,6 @@ import { LoadingViewComp } from "./view/LoadingViewComp";
import { smc } from "../common/SingletonModuleComp";
import { MonSet, HeroInfo } from "../common/config/heroSet";
import { SkillSet } from "../common/config/SkillSet";
import { Sitems } from "../common/config/ItemSet";
// import {data} from "../data/data";
/**
@@ -88,7 +87,6 @@ export class Initialize extends ecs.Entity {
queue.complete = () => {
// console.log("加载完成!",smc.heros);
smc.skills=SkillSet;
smc.sitems=Sitems;
var uic: UICallbacks = {
onAdded: (node: Node, params: any) => {
var comp = node.getComponent(LoadingViewComp) as ecs.Comp;

View File

@@ -34,12 +34,3 @@ export class HCard extends ecs.Entity {
super.destroy();
}
}
/** HCard 模块业务逻辑系统组件,如无业务逻辑处理可删除此对象 */
export class EcsHCardSystem extends ecs.System {
constructor() {
super();
// this.add(new ecs.ComblockSystem());
}
}

View File

@@ -31,21 +31,17 @@ export class HeroHomeComp extends CCComp {
loads(){
let heros:any=HeroList
let hc:number =HeroList.length
console.log("hero_home heros:",heros,hc)
let parent= this.node.getChildByName("heros").getChildByName("view").getChildByName("content")
parent.getComponent(UITransform).width=hc*150
console.log("parent:",parent)
for (let i = 0; i < hc; i++) {
let hcc =ecs.getEntity<HeroCard>(HeroCard)
hcc.load(HeroList[i],parent)
}
}
hero_show(uuid:number) {
console.log("hero_home hero_show:",uuid)
this.h_uuid=uuid
this.role=smc.heros[uuid]
this.hero=HeroInfo[uuid]
console.log("hero_home hero:",this.hero)
let tal=this.node.getChildByName("sk").getChildByName("tal");
let sk_node= this.node.getChildByName("sk");
let skill = SkillSet[this.hero.sk2[0]]
@@ -160,7 +156,6 @@ export class HeroHomeComp extends CCComp {
lv_up(){
console.log("升级",smc.vmdata.items[1001],((LvUp[0]+this.hero.lvexp)*this.role.lv))
if(smc.vmdata.items[1001] < ((LvUp[0]+this.hero.lvexp)*this.role.lv)||smc.vmdata.gold < (UpGold.LvUp*this.role.lv)){
oops.gui.toast("资源不足,升级失败");
return

View File

@@ -0,0 +1,38 @@
import { instantiate, Prefab } from "cc";
import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ecs/ECS";
import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops";
import { MSCardComp } from "./MSCardComp";
import { smc } from "../common/SingletonModuleComp";
/** MSCard 模块 */
@ecs.register(`MSCard`)
export class MSCard extends ecs.Entity {
/** 实始添加的数据层组件 */
protected init() {
// this.addComponents<ecs.Comp>();
}
load(uuid:number=1001,parent:any) {
var path = "game/gui/MSCard";
// var icon_path = "game/heros/herois"
// resources.load(icon_path, SpriteAtlas, (err: any, atlas) => {
// const sprite = node.getChildByName("Mask").getChildByName("icon").getComponent(Sprite);
// sprite.spriteFrame = atlas.getSpriteFrame(HeroInfo[uuid].path);
// });
var prefab: Prefab = oops.res.get(path, Prefab)!;
console.log("load_hcard",prefab)
var node = instantiate(prefab);
node.parent = parent
var msc = node.getComponent(MSCardComp)!;
msc.s_uuid= uuid
if(smc.mskill==uuid) msc.is_selected=true
this.add(msc)
}
/** 模块资源释放 */
destroy() {
// 注: 自定义释放逻辑,视图层实现 ecs.IComp 接口的 ecs 组件需要手动释放
super.destroy();
}
}

View File

@@ -0,0 +1,9 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "b808913f-7dc0-4dbf-9e74-12b5338a39ee",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@@ -0,0 +1,30 @@
import { _decorator } 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('MSCardComp')
@ecs.register('MSCardComp', false)
export class MSCardComp extends CCComp {
s_uuid: number = 0;
is_updated: boolean = false;
is_select: boolean = false;
is_selected: boolean = false;
/** 视图层逻辑代码分离演示 */
start() {
console.log("MSCardComp start");
if(this.is_updated){ this.node.getChildByName("update").active=true }else{ this.node.getChildByName("update").active=false }
if(this.is_select){ this.node.getChildByName("select").active=true }else{ this.node.getChildByName("select").active=false }
if(this.is_selected){ this.node.getChildByName("selected").active=true }else{ this.node.getChildByName("selected").active=false }
}
/** 视图对象通过 ecs.Entity.remove(ModuleViewComp) 删除组件是触发组件处理自定义释放逻辑 */
reset() {
this.node.destroy();
}
}

View File

@@ -0,0 +1,9 @@
{
"ver": "4.0.23",
"importer": "typescript",
"imported": true,
"uuid": "f7a30834-31c8-405a-9f9d-70555981d611",
"files": [],
"subMetas": {},
"userData": {}
}

View File

@@ -33,7 +33,7 @@ export class MissionHomeComp extends CCComp {
}
start_mission(e:any,args:any) {
console.log("start_mission")
console.log("mission home start_mission")
for(let i=0;i<this.heros.length;i++){
this.heros[i].to_destroy()
}
@@ -55,7 +55,6 @@ export class MissionHomeComp extends CCComp {
}
}
select_hero(h_uuid:number){
console.log("select_hero",h_uuid)
for(let i=0;i<4;i++){
if(this.heros_pos[i].uuid==0){
this.heros_pos[i].uuid=h_uuid
@@ -63,17 +62,14 @@ export class MissionHomeComp extends CCComp {
break
}
}
console.log("select_hero",this.heros_pos)
}
cancel_hero(h_uuid:number){
console.log("cancel_hero",h_uuid)
for(let i=0;i<4;i++){
if(this.heros_pos[i].uuid==h_uuid){
this.heros_pos[i].uuid=0
this.destory_hero(h_uuid)
}
}
console.log("cancel_hero",this.heros_pos)
}
call_hero(h_uuid:number,index:number){
var path = "game/heros/uiheros/"+HeroInfo[h_uuid].path;
@@ -83,10 +79,8 @@ export class MissionHomeComp extends CCComp {
node.parent = scene.entityLayer!.node!
node.setPosition(this.heros_pos[index].px,BoxSet.GAME_LINE,0);
let comp = node.getComponent(UiHeroComp)
console.log("call_hero",node)
comp.h_uuid = h_uuid
this.heros.push(comp)
console.log("call heros",this.heros)
}
destory_hero(h_uuid:number){
console.log("destory hero",this.heros)