dd
This commit is contained in:
@@ -23,19 +23,22 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"__id__": 8
|
"__id__": 8
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"__id__": 14
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"_active": true,
|
"_active": true,
|
||||||
"_components": [
|
"_components": [
|
||||||
{
|
{
|
||||||
"__id__": 14
|
"__id__": 20
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"__id__": 16
|
"__id__": 22
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"_prefab": {
|
"_prefab": {
|
||||||
"__id__": 18
|
"__id__": 24
|
||||||
},
|
},
|
||||||
"_lpos": {
|
"_lpos": {
|
||||||
"__type__": "cc.Vec3",
|
"__type__": "cc.Vec3",
|
||||||
@@ -75,7 +78,7 @@
|
|||||||
"__id__": 1
|
"__id__": 1
|
||||||
},
|
},
|
||||||
"_children": [],
|
"_children": [],
|
||||||
"_active": true,
|
"_active": false,
|
||||||
"_components": [
|
"_components": [
|
||||||
{
|
{
|
||||||
"__id__": 3
|
"__id__": 3
|
||||||
@@ -338,6 +341,142 @@
|
|||||||
"targetOverrides": null,
|
"targetOverrides": null,
|
||||||
"nestedPrefabInstanceRoots": null
|
"nestedPrefabInstanceRoots": null
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"__type__": "cc.Node",
|
||||||
|
"_name": "active",
|
||||||
|
"_objFlags": 0,
|
||||||
|
"__editorExtras__": {},
|
||||||
|
"_parent": {
|
||||||
|
"__id__": 1
|
||||||
|
},
|
||||||
|
"_children": [],
|
||||||
|
"_active": false,
|
||||||
|
"_components": [
|
||||||
|
{
|
||||||
|
"__id__": 15
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"__id__": 17
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"_prefab": {
|
||||||
|
"__id__": 19
|
||||||
|
},
|
||||||
|
"_lpos": {
|
||||||
|
"__type__": "cc.Vec3",
|
||||||
|
"x": 0,
|
||||||
|
"y": 0,
|
||||||
|
"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__": 14
|
||||||
|
},
|
||||||
|
"_enabled": true,
|
||||||
|
"__prefab": {
|
||||||
|
"__id__": 16
|
||||||
|
},
|
||||||
|
"_contentSize": {
|
||||||
|
"__type__": "cc.Size",
|
||||||
|
"width": 110,
|
||||||
|
"height": 110
|
||||||
|
},
|
||||||
|
"_anchorPoint": {
|
||||||
|
"__type__": "cc.Vec2",
|
||||||
|
"x": 0,
|
||||||
|
"y": 0
|
||||||
|
},
|
||||||
|
"_id": ""
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"__type__": "cc.CompPrefabInfo",
|
||||||
|
"fileId": "13sh5Lj+5FIbltkc68Xf4S"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"__type__": "cc.Sprite",
|
||||||
|
"_name": "",
|
||||||
|
"_objFlags": 0,
|
||||||
|
"__editorExtras__": {},
|
||||||
|
"node": {
|
||||||
|
"__id__": 14
|
||||||
|
},
|
||||||
|
"_enabled": true,
|
||||||
|
"__prefab": {
|
||||||
|
"__id__": 18
|
||||||
|
},
|
||||||
|
"_customMaterial": null,
|
||||||
|
"_srcBlendFactor": 2,
|
||||||
|
"_dstBlendFactor": 4,
|
||||||
|
"_color": {
|
||||||
|
"__type__": "cc.Color",
|
||||||
|
"r": 255,
|
||||||
|
"g": 255,
|
||||||
|
"b": 255,
|
||||||
|
"a": 255
|
||||||
|
},
|
||||||
|
"_spriteFrame": {
|
||||||
|
"__uuid__": "fdf9c650-fb92-49bb-82ce-3007df7745b6@f9941",
|
||||||
|
"__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": "6azJ507G9Lq60zCRcRIvnI"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"__type__": "cc.PrefabInfo",
|
||||||
|
"root": {
|
||||||
|
"__id__": 1
|
||||||
|
},
|
||||||
|
"asset": {
|
||||||
|
"__id__": 0
|
||||||
|
},
|
||||||
|
"fileId": "8eCsq/oFNMYb1bIWCaEPbY",
|
||||||
|
"instance": null,
|
||||||
|
"targetOverrides": null,
|
||||||
|
"nestedPrefabInstanceRoots": null
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"__type__": "cc.UITransform",
|
"__type__": "cc.UITransform",
|
||||||
"_name": "",
|
"_name": "",
|
||||||
@@ -348,7 +487,7 @@
|
|||||||
},
|
},
|
||||||
"_enabled": true,
|
"_enabled": true,
|
||||||
"__prefab": {
|
"__prefab": {
|
||||||
"__id__": 15
|
"__id__": 21
|
||||||
},
|
},
|
||||||
"_contentSize": {
|
"_contentSize": {
|
||||||
"__type__": "cc.Size",
|
"__type__": "cc.Size",
|
||||||
@@ -376,7 +515,7 @@
|
|||||||
},
|
},
|
||||||
"_enabled": true,
|
"_enabled": true,
|
||||||
"__prefab": {
|
"__prefab": {
|
||||||
"__id__": 17
|
"__id__": 23
|
||||||
},
|
},
|
||||||
"_id": ""
|
"_id": ""
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
{
|
|
||||||
"ver": "1.2.0",
|
|
||||||
"importer": "directory",
|
|
||||||
"imported": true,
|
|
||||||
"uuid": "d5604362-ce57-4bc2-9a05-cb1ba2e170a2",
|
|
||||||
"files": [],
|
|
||||||
"subMetas": {},
|
|
||||||
"userData": {}
|
|
||||||
}
|
|
||||||
BIN
assets/resources/gui/gui/blue.png
Normal file
BIN
assets/resources/gui/gui/blue.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.9 KiB |
134
assets/resources/gui/gui/blue.png.meta
Normal file
134
assets/resources/gui/gui/blue.png.meta
Normal file
@@ -0,0 +1,134 @@
|
|||||||
|
{
|
||||||
|
"ver": "1.0.26",
|
||||||
|
"importer": "image",
|
||||||
|
"imported": true,
|
||||||
|
"uuid": "6f0c2175-1556-4c71-a736-a1c8b1f96c84",
|
||||||
|
"files": [
|
||||||
|
".json",
|
||||||
|
".png"
|
||||||
|
],
|
||||||
|
"subMetas": {
|
||||||
|
"6c48a": {
|
||||||
|
"importer": "texture",
|
||||||
|
"uuid": "6f0c2175-1556-4c71-a736-a1c8b1f96c84@6c48a",
|
||||||
|
"displayName": "blue",
|
||||||
|
"id": "6c48a",
|
||||||
|
"name": "texture",
|
||||||
|
"userData": {
|
||||||
|
"wrapModeS": "clamp-to-edge",
|
||||||
|
"wrapModeT": "clamp-to-edge",
|
||||||
|
"minfilter": "linear",
|
||||||
|
"magfilter": "linear",
|
||||||
|
"mipfilter": "none",
|
||||||
|
"anisotropy": 0,
|
||||||
|
"isUuid": true,
|
||||||
|
"imageUuidOrDatabaseUri": "6f0c2175-1556-4c71-a736-a1c8b1f96c84",
|
||||||
|
"visible": false
|
||||||
|
},
|
||||||
|
"ver": "1.0.22",
|
||||||
|
"imported": true,
|
||||||
|
"files": [
|
||||||
|
".json"
|
||||||
|
],
|
||||||
|
"subMetas": {}
|
||||||
|
},
|
||||||
|
"f9941": {
|
||||||
|
"importer": "sprite-frame",
|
||||||
|
"uuid": "6f0c2175-1556-4c71-a736-a1c8b1f96c84@f9941",
|
||||||
|
"displayName": "blue",
|
||||||
|
"id": "f9941",
|
||||||
|
"name": "spriteFrame",
|
||||||
|
"userData": {
|
||||||
|
"trimType": "auto",
|
||||||
|
"trimThreshold": 1,
|
||||||
|
"rotated": false,
|
||||||
|
"offsetX": 0,
|
||||||
|
"offsetY": 0,
|
||||||
|
"trimX": 0,
|
||||||
|
"trimY": 0,
|
||||||
|
"width": 177,
|
||||||
|
"height": 183,
|
||||||
|
"rawWidth": 177,
|
||||||
|
"rawHeight": 183,
|
||||||
|
"borderTop": 0,
|
||||||
|
"borderBottom": 0,
|
||||||
|
"borderLeft": 0,
|
||||||
|
"borderRight": 0,
|
||||||
|
"packable": true,
|
||||||
|
"pixelsToUnit": 100,
|
||||||
|
"pivotX": 0.5,
|
||||||
|
"pivotY": 0.5,
|
||||||
|
"meshType": 0,
|
||||||
|
"vertices": {
|
||||||
|
"rawPosition": [
|
||||||
|
-88.5,
|
||||||
|
-91.5,
|
||||||
|
0,
|
||||||
|
88.5,
|
||||||
|
-91.5,
|
||||||
|
0,
|
||||||
|
-88.5,
|
||||||
|
91.5,
|
||||||
|
0,
|
||||||
|
88.5,
|
||||||
|
91.5,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
2,
|
||||||
|
2,
|
||||||
|
1,
|
||||||
|
3
|
||||||
|
],
|
||||||
|
"uv": [
|
||||||
|
0,
|
||||||
|
183,
|
||||||
|
177,
|
||||||
|
183,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
177,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"nuv": [
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
1,
|
||||||
|
1
|
||||||
|
],
|
||||||
|
"minPos": [
|
||||||
|
-88.5,
|
||||||
|
-91.5,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"maxPos": [
|
||||||
|
88.5,
|
||||||
|
91.5,
|
||||||
|
0
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"isUuid": true,
|
||||||
|
"imageUuidOrDatabaseUri": "6f0c2175-1556-4c71-a736-a1c8b1f96c84@6c48a",
|
||||||
|
"atlasUuid": ""
|
||||||
|
},
|
||||||
|
"ver": "1.0.12",
|
||||||
|
"imported": true,
|
||||||
|
"files": [
|
||||||
|
".json"
|
||||||
|
],
|
||||||
|
"subMetas": {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"userData": {
|
||||||
|
"hasAlpha": true,
|
||||||
|
"type": "sprite-frame",
|
||||||
|
"fixAlphaTransparencyArtifacts": false,
|
||||||
|
"redirect": "6f0c2175-1556-4c71-a736-a1c8b1f96c84@f9941"
|
||||||
|
}
|
||||||
|
}
|
||||||
BIN
assets/resources/gui/gui/focus.png
Normal file
BIN
assets/resources/gui/gui/focus.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.6 KiB |
134
assets/resources/gui/gui/focus.png.meta
Normal file
134
assets/resources/gui/gui/focus.png.meta
Normal file
@@ -0,0 +1,134 @@
|
|||||||
|
{
|
||||||
|
"ver": "1.0.26",
|
||||||
|
"importer": "image",
|
||||||
|
"imported": true,
|
||||||
|
"uuid": "fdf9c650-fb92-49bb-82ce-3007df7745b6",
|
||||||
|
"files": [
|
||||||
|
".json",
|
||||||
|
".png"
|
||||||
|
],
|
||||||
|
"subMetas": {
|
||||||
|
"6c48a": {
|
||||||
|
"importer": "texture",
|
||||||
|
"uuid": "fdf9c650-fb92-49bb-82ce-3007df7745b6@6c48a",
|
||||||
|
"displayName": "focus",
|
||||||
|
"id": "6c48a",
|
||||||
|
"name": "texture",
|
||||||
|
"userData": {
|
||||||
|
"wrapModeS": "clamp-to-edge",
|
||||||
|
"wrapModeT": "clamp-to-edge",
|
||||||
|
"minfilter": "linear",
|
||||||
|
"magfilter": "linear",
|
||||||
|
"mipfilter": "none",
|
||||||
|
"anisotropy": 0,
|
||||||
|
"isUuid": true,
|
||||||
|
"imageUuidOrDatabaseUri": "fdf9c650-fb92-49bb-82ce-3007df7745b6",
|
||||||
|
"visible": false
|
||||||
|
},
|
||||||
|
"ver": "1.0.22",
|
||||||
|
"imported": true,
|
||||||
|
"files": [
|
||||||
|
".json"
|
||||||
|
],
|
||||||
|
"subMetas": {}
|
||||||
|
},
|
||||||
|
"f9941": {
|
||||||
|
"importer": "sprite-frame",
|
||||||
|
"uuid": "fdf9c650-fb92-49bb-82ce-3007df7745b6@f9941",
|
||||||
|
"displayName": "focus",
|
||||||
|
"id": "f9941",
|
||||||
|
"name": "spriteFrame",
|
||||||
|
"userData": {
|
||||||
|
"trimType": "auto",
|
||||||
|
"trimThreshold": 1,
|
||||||
|
"rotated": false,
|
||||||
|
"offsetX": 0,
|
||||||
|
"offsetY": 0,
|
||||||
|
"trimX": 0,
|
||||||
|
"trimY": 0,
|
||||||
|
"width": 189,
|
||||||
|
"height": 189,
|
||||||
|
"rawWidth": 189,
|
||||||
|
"rawHeight": 189,
|
||||||
|
"borderTop": 0,
|
||||||
|
"borderBottom": 0,
|
||||||
|
"borderLeft": 0,
|
||||||
|
"borderRight": 0,
|
||||||
|
"packable": true,
|
||||||
|
"pixelsToUnit": 100,
|
||||||
|
"pivotX": 0.5,
|
||||||
|
"pivotY": 0.5,
|
||||||
|
"meshType": 0,
|
||||||
|
"vertices": {
|
||||||
|
"rawPosition": [
|
||||||
|
-94.5,
|
||||||
|
-94.5,
|
||||||
|
0,
|
||||||
|
94.5,
|
||||||
|
-94.5,
|
||||||
|
0,
|
||||||
|
-94.5,
|
||||||
|
94.5,
|
||||||
|
0,
|
||||||
|
94.5,
|
||||||
|
94.5,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"indexes": [
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
2,
|
||||||
|
2,
|
||||||
|
1,
|
||||||
|
3
|
||||||
|
],
|
||||||
|
"uv": [
|
||||||
|
0,
|
||||||
|
189,
|
||||||
|
189,
|
||||||
|
189,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
189,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"nuv": [
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
1,
|
||||||
|
1,
|
||||||
|
1
|
||||||
|
],
|
||||||
|
"minPos": [
|
||||||
|
-94.5,
|
||||||
|
-94.5,
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"maxPos": [
|
||||||
|
94.5,
|
||||||
|
94.5,
|
||||||
|
0
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"isUuid": true,
|
||||||
|
"imageUuidOrDatabaseUri": "fdf9c650-fb92-49bb-82ce-3007df7745b6@6c48a",
|
||||||
|
"atlasUuid": ""
|
||||||
|
},
|
||||||
|
"ver": "1.0.12",
|
||||||
|
"imported": true,
|
||||||
|
"files": [
|
||||||
|
".json"
|
||||||
|
],
|
||||||
|
"subMetas": {}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"userData": {
|
||||||
|
"hasAlpha": true,
|
||||||
|
"type": "sprite-frame",
|
||||||
|
"fixAlphaTransparencyArtifacts": false,
|
||||||
|
"redirect": "fdf9c650-fb92-49bb-82ce-3007df7745b6@f9941"
|
||||||
|
}
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -32,11 +32,11 @@ export class SingletonModuleComp extends ecs.Comp {
|
|||||||
vm_data: any = {
|
vm_data: any = {
|
||||||
name : "数据测试",
|
name : "数据测试",
|
||||||
/** 当前等级 */
|
/** 当前等级 */
|
||||||
porwer: 0,
|
cards:{
|
||||||
/** 当前经验 */
|
level:1,
|
||||||
def : 0,
|
level_max:10,
|
||||||
/** 下级经验 */
|
eid:0,
|
||||||
speed : 0,
|
},
|
||||||
hp: {
|
hp: {
|
||||||
min:20,
|
min:20,
|
||||||
max:30
|
max:30
|
||||||
@@ -46,18 +46,15 @@ export class SingletonModuleComp extends ecs.Comp {
|
|||||||
max: 30
|
max: 30
|
||||||
},
|
},
|
||||||
gold: {
|
gold: {
|
||||||
min: 0,
|
min: 3,
|
||||||
max: 10
|
max: 3,
|
||||||
|
time:0,
|
||||||
|
cd:30,
|
||||||
},
|
},
|
||||||
shuaxin: {
|
shuaxin: {
|
||||||
min: 0,
|
|
||||||
max: 2,
|
|
||||||
speed:1,
|
|
||||||
},
|
|
||||||
gold_add: {
|
|
||||||
min: 0,
|
min: 0,
|
||||||
max: 10,
|
max: 10,
|
||||||
speed:2,
|
speed:1,
|
||||||
},
|
},
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -8,12 +8,13 @@
|
|||||||
export const CardSet = {
|
export const CardSet = {
|
||||||
1001:{
|
1001:{
|
||||||
uuid:1001,
|
uuid:1001,
|
||||||
name:'嬴政',
|
name:'护盾战士',
|
||||||
level:1,
|
level:1,
|
||||||
prefab_path:'yinzheng',
|
prefab_path:'yinzheng',
|
||||||
hp:100,
|
atk:2,
|
||||||
power:100,
|
hp:10,
|
||||||
speed:100,
|
power:50, //每0.1秒增加1能量
|
||||||
|
speed:50,
|
||||||
skill:{ }
|
skill:{ }
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ export class ControllerComp extends CCComp {
|
|||||||
card.load(pos,1001,cards_node);
|
card.load(pos,1001,cards_node);
|
||||||
x=x+120
|
x=x+120
|
||||||
}
|
}
|
||||||
|
this.node.getChildByName("cards").getChildByName("active").active = false
|
||||||
}
|
}
|
||||||
/** 转场 */
|
/** 转场 */
|
||||||
protected update(dt: number): void {
|
protected update(dt: number): void {
|
||||||
|
|||||||
@@ -60,13 +60,10 @@ export class MapViewComp extends CCComp {
|
|||||||
|
|
||||||
}
|
}
|
||||||
gold_add(dt: number) {
|
gold_add(dt: number) {
|
||||||
smc.vm_data.gold_add.min += smc.vm_data.gold_add.speed*dt;
|
smc.vm_data.gold.time += dt;
|
||||||
if (smc.vm_data.gold_add.min >= smc.vm_data.gold_add.max) {
|
if (smc.vm_data.gold.time >= smc.vm_data.gold.cd) {
|
||||||
smc.vm_data.gold_add.min = 0;
|
smc.vm_data.gold.min = smc.vm_data.gold.max;
|
||||||
if (smc.vm_data.gold.min < smc.vm_data.gold.max) {
|
smc.vm_data.gold.time = 0;
|
||||||
smc.vm_data.gold.min = smc.vm_data.gold.min + 1
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
shuaxin(dt: number) {
|
shuaxin(dt: number) {
|
||||||
|
|||||||
@@ -3,7 +3,8 @@ import { ecs } from "../../../../extensions/oops-plugin-framework/assets/libs/ec
|
|||||||
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
|
import { CCComp } from "../../../../extensions/oops-plugin-framework/assets/module/common/CCComp";
|
||||||
import { data } from "../data/data";
|
import { data } from "../data/data";
|
||||||
import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops";
|
import { oops } from "../../../../extensions/oops-plugin-framework/assets/core/Oops";
|
||||||
|
import { smc } from "../common/SingletonModuleComp";
|
||||||
|
import { CardSet } from "../common/config/CardSet";
|
||||||
const { ccclass, property } = _decorator;
|
const { ccclass, property } = _decorator;
|
||||||
|
|
||||||
/** 视图层对象 */
|
/** 视图层对象 */
|
||||||
@@ -39,22 +40,40 @@ export class HeroCardViewComp extends CCComp {
|
|||||||
}
|
}
|
||||||
|
|
||||||
onTouchMove(event: EventTouch) {
|
onTouchMove(event: EventTouch) {
|
||||||
|
smc.vm_data.cards.eid = this.ent.eid;
|
||||||
|
let parent = this.node.parent;
|
||||||
|
let active = parent.getChildByName("active");
|
||||||
|
active.setPosition(this.node.position.x,this.node.position.y)
|
||||||
|
active.active = true;
|
||||||
|
console.log(parent);
|
||||||
|
// if(this.ent.eid == smc.vm_data.cards.eid){
|
||||||
|
// this.node.getChildByName("active").active = true;
|
||||||
|
// }else{
|
||||||
|
// this.node.getChildByName("active").active = false;
|
||||||
|
// }
|
||||||
console.log("onTouchMove");
|
console.log("onTouchMove");
|
||||||
let delta = event.getDelta();
|
let delta = event.getDelta();
|
||||||
this.node.setPosition(this.node.position.x+delta.x,this.node.position.y+delta.y);
|
this.node.setPosition(this.node.position.x+delta.x,this.node.position.y+delta.y);
|
||||||
}
|
}
|
||||||
onTouchEnd(){
|
onTouchEnd(){
|
||||||
if(this.node.position.y-this.pos_y > 50){
|
let parent = this.node.parent;
|
||||||
|
let active = parent.getChildByName("active");
|
||||||
|
active.setPosition(this.pos_x,this.pos_y)
|
||||||
|
if(this.node.position.y-this.pos_y > 110){
|
||||||
|
active.active = false;
|
||||||
this.use_card()
|
this.use_card()
|
||||||
}else{
|
}else{
|
||||||
this.node.setPosition(this.pos_x,this.pos_y);
|
this.node.setPosition(this.pos_x,this.pos_y);
|
||||||
}
|
}
|
||||||
console.log(ecs.query(ecs.allOf(HeroCardViewComp)))
|
|
||||||
|
|
||||||
}
|
}
|
||||||
use_card(){
|
use_card(){
|
||||||
oops.message.dispatchEvent("do_add_hero",this.ent)
|
if(smc.vm_data.gold.min >= CardSet[this.card_uid].level){
|
||||||
this.ent.destroy();
|
oops.message.dispatchEvent("do_add_hero",this.ent)
|
||||||
|
this.ent.destroy();
|
||||||
|
smc.vm_data.gold.min -= CardSet[this.card_uid].level;
|
||||||
|
}else{
|
||||||
|
this.node.setPosition(this.pos_x,this.pos_y);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/** 视图层逻辑代码分离演示 */
|
/** 视图层逻辑代码分离演示 */
|
||||||
start() {
|
start() {
|
||||||
|
|||||||
@@ -27,36 +27,41 @@ export class MonsterViewComp extends CCComp {
|
|||||||
/** 角色动画 */
|
/** 角色动画 */
|
||||||
as: MonsterSpine = null!;
|
as: MonsterSpine = null!;
|
||||||
hero_name : string = "hero";
|
hero_name : string = "hero";
|
||||||
/** 角色阵营 1:hero -1 :monster */
|
camp: number = 1; /** 角色阵营 1:hero -1 :monster */
|
||||||
camp: number = 1;
|
type: number = 1; /**角色类型 1:前排 2 后排 */
|
||||||
/**角色类型 1:近战 2 远程 */
|
state: number = 1; /** 状态 1:move ,2: act 3: stop */
|
||||||
type: number = 1;
|
|
||||||
/** 状态 1:move ,2: act 3: stop */
|
hp: number = 100; /** 血量 */
|
||||||
state: number = 1;
|
hp_max: number = 100; /** 最大血量 */
|
||||||
/** 血量 */
|
hp_speed: number = 0; //回复速度
|
||||||
hp: number = 100;
|
|
||||||
hp_max: number = 100;
|
power: number = 0; /**能量**/
|
||||||
hp_speed: number = 0; //回复速度
|
power_max: number = 100; /** 能量最大值 */
|
||||||
/**能量**/
|
power_speed: number = 1; //能量回复速度每0.1秒回复量
|
||||||
power: number = 0;
|
|
||||||
power_max: number = 100;
|
skill_name: string = "base"; //技能名称
|
||||||
power_speed: number = 1; //回复速度
|
max_skill_name: string = "base"; //大技能名称
|
||||||
skill_name: string = "base";
|
|
||||||
max_skill_name: string = "base";
|
atk: number = 10; /**攻击力 */
|
||||||
/**攻击力 */
|
|
||||||
atk: number = 10;
|
|
||||||
/**攻击速度 */
|
|
||||||
// atk_speed: number = 1;
|
// atk_speed: number = 1;
|
||||||
atk_cd: number = 1.3;
|
atk_cd: number = 1.3; /**攻击速度 攻击间隔 */
|
||||||
atk_time: number = 0;
|
atk_time: number = 0; /** 冷却时间 */
|
||||||
/** 角色移动速度 */
|
|
||||||
speed: number = 100;
|
speed: number = 100; /** 角色移动速度 */
|
||||||
/** 角色初始速度 */
|
ospeed: number = 100; /** 角色初始速度 */
|
||||||
ospeed: number = 100;
|
|
||||||
Tpos: Vec3 = v3(0,-60,0);
|
Tpos: Vec3 = v3(0,-60,0);
|
||||||
stop_cd: number = 0;
|
stop_cd: number = 0; /*停止倒计时*/
|
||||||
private timer:Timer = new Timer(0.1);
|
|
||||||
is_dead:boolean = false;
|
private timer:Timer = new Timer(0.1); //计时器
|
||||||
|
is_dead:boolean = false; //是否摧毁
|
||||||
|
|
||||||
|
/*暴击*/
|
||||||
|
crit_rate:number = 0; //暴击率
|
||||||
|
crit_damage:number = 2; //暴击伤害倍率
|
||||||
|
/*闪避*/
|
||||||
|
dodge_rate:number = 0; //闪避率
|
||||||
|
shield:number = 0; //护盾量
|
||||||
|
shield_time:number = 0; //护盾持续时间
|
||||||
|
|
||||||
/** 视图层逻辑代码分离演示 */
|
/** 视图层逻辑代码分离演示 */
|
||||||
start () {
|
start () {
|
||||||
|
|||||||
Reference in New Issue
Block a user