Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
PU20
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
template admin
PU20
Commits
d73a4299
Commit
d73a4299
authored
4 years ago
by
jeff
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加删除功能
parent
d20fb4a4
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
292 additions
and
19 deletions
+292
-19
hitItem.prefab
play/assets/scene/prefab/hitItem.prefab
+246
-18
hitItem.js
play/assets/scene/scene/hitItem.js
+10
-1
btn_x.png
play/assets/scene/textures/btn_x.png
+0
-0
btn_x.png.meta
play/assets/scene/textures/btn_x.png.meta
+36
-0
No files found.
play/assets/scene/prefab/hitItem.prefab
View file @
d73a4299
...
@@ -28,16 +28,19 @@
...
@@ -28,16 +28,19 @@
},
},
{
{
"__id__": 14
"__id__": 14
},
{
"__id__": 20
}
}
],
],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__":
24
"__id__":
30
}
}
],
],
"_prefab": {
"_prefab": {
"__id__":
25
"__id__":
31
},
},
"_opacity": 255,
"_opacity": 255,
"_color": {
"_color": {
...
@@ -491,30 +494,252 @@
...
@@ -491,30 +494,252 @@
},
},
{
{
"__type__": "cc.Node",
"__type__": "cc.Node",
"_name": "
hand
",
"_name": "
btn_x
",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 1
"__id__": 1
},
},
"_children": [
"_children": [],
"_active": true,
"_components": [
{
{
"__id__": 15
"__id__": 15
},
},
{
"__id__": 16
},
{
{
"__id__": 18
"__id__": 18
}
}
],
],
"_prefab": {
"__id__": 19
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 34,
"height": 34
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-178.892,
53.462,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": ""
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 14
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "b7316664-aba4-4008-a54a-11908a6c0b15"
},
"_type": 0,
"_sizeMode": 1,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": ""
},
{
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 14
},
"_enabled": true,
"_normalMaterial": null,
"_grayMaterial": null,
"duration": 0.1,
"zoomScale": 1.2,
"clickEvents": [
{
"__id__": 17
}
],
"_N$interactable": true,
"_N$enableAutoGrayEffect": false,
"_N$transition": 0,
"transition": 0,
"_N$normalColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"pressedColor": {
"__type__": "cc.Color",
"r": 211,
"g": 211,
"b": 211,
"a": 255
},
"_N$hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"hoverColor": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_N$disabledColor": {
"__type__": "cc.Color",
"r": 124,
"g": 124,
"b": 124,
"a": 255
},
"_N$normalSprite": null,
"_N$pressedSprite": null,
"pressedSprite": null,
"_N$hoverSprite": null,
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": null,
"_id": ""
},
{
"__type__": "cc.ClickEvent",
"target": {
"__id__": 1
},
"component": "",
"_componentId": "57f79KAb0tNU7HjHMpUOk2e",
"handler": "onClickHide",
"customEventData": ""
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 14
},
"_enabled": true,
"alignMode": 1,
"_target": null,
"_alignFlags": 9,
"_left": -20.391999999999996,
"_right": 0,
"_top": -23.962000000000003,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 0,
"_originalHeight": 0,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "2ce7d58d-b6fe-4ef7-a128-de76f672a803"
},
"fileId": "49bqoo7I9FCKRZC0ySxp3O",
"sync": false
},
{
"__type__": "cc.Node",
"_name": "hand",
"_objFlags": 0,
"_parent": {
"__id__": 1
},
"_children": [
{
"__id__": 21
},
{
"__id__": 24
}
],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 2
1
"__id__": 2
7
},
},
{
{
"__id__": 2
2
"__id__": 2
8
}
}
],
],
"_prefab": {
"_prefab": {
"__id__": 2
3
"__id__": 2
9
},
},
"_opacity": 255,
"_opacity": 255,
"_color": {
"_color": {
...
@@ -568,17 +793,17 @@
...
@@ -568,17 +793,17 @@
"_name": "icon_dian",
"_name": "icon_dian",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__":
14
"__id__":
20
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__":
16
"__id__":
22
}
}
],
],
"_prefab": {
"_prefab": {
"__id__":
17
"__id__":
23
},
},
"_opacity": 255,
"_opacity": 255,
"_color": {
"_color": {
...
@@ -632,7 +857,7 @@
...
@@ -632,7 +857,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__":
15
"__id__":
21
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -675,17 +900,17 @@
...
@@ -675,17 +900,17 @@
"_name": "icon_hand",
"_name": "icon_hand",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__":
14
"__id__":
20
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__":
19
"__id__":
25
}
}
],
],
"_prefab": {
"_prefab": {
"__id__": 2
0
"__id__": 2
6
},
},
"_opacity": 255,
"_opacity": 255,
"_color": {
"_color": {
...
@@ -739,7 +964,7 @@
...
@@ -739,7 +964,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__":
18
"__id__":
24
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -782,7 +1007,7 @@
...
@@ -782,7 +1007,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__":
14
"__id__":
20
},
},
"_enabled": true,
"_enabled": true,
"_defaultClip": {
"_defaultClip": {
...
@@ -801,7 +1026,7 @@
...
@@ -801,7 +1026,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__":
14
"__id__":
20
},
},
"_enabled": true,
"_enabled": true,
"alignMode": 1,
"alignMode": 1,
...
@@ -849,7 +1074,7 @@
...
@@ -849,7 +1074,7 @@
"__id__": 4
"__id__": 4
},
},
"handAnim": {
"handAnim": {
"__id__": 2
1
"__id__": 2
7
},
},
"sprite": {
"sprite": {
"__id__": 12
"__id__": 12
...
@@ -857,6 +1082,9 @@
...
@@ -857,6 +1082,9 @@
"tipClip": {
"tipClip": {
"__uuid__": "e0bcf4cc-35a7-4d61-b202-8dd49299c2c0"
"__uuid__": "e0bcf4cc-35a7-4d61-b202-8dd49299c2c0"
},
},
"btnX": {
"__id__": 14
},
"_id": ""
"_id": ""
},
},
{
{
...
...
This diff is collapsed.
Click to expand it.
play/assets/scene/scene/hitItem.js
View file @
d73a4299
...
@@ -8,7 +8,8 @@ cc.Class({
...
@@ -8,7 +8,8 @@ cc.Class({
tipsAnim
:
cc
.
Animation
,
tipsAnim
:
cc
.
Animation
,
handAnim
:
cc
.
Animation
,
handAnim
:
cc
.
Animation
,
sprite
:
cc
.
Sprite
,
sprite
:
cc
.
Sprite
,
tipClip
:
cc
.
AudioClip
tipClip
:
cc
.
AudioClip
,
btnX
:
cc
.
Node
},
},
data
:
null
,
data
:
null
,
...
@@ -18,6 +19,7 @@ cc.Class({
...
@@ -18,6 +19,7 @@ cc.Class({
this
.
quan
.
active
=
false
this
.
quan
.
active
=
false
this
.
tipsAnim
.
node
.
active
=
false
this
.
tipsAnim
.
node
.
active
=
false
this
.
handAnim
.
node
.
active
=
false
this
.
handAnim
.
node
.
active
=
false
this
.
btnX
.
active
=
false
},
},
onEnable
()
{
onEnable
()
{
...
@@ -51,6 +53,7 @@ cc.Class({
...
@@ -51,6 +53,7 @@ cc.Class({
if
(
this
.
_playing
)
return
if
(
this
.
_playing
)
return
if
(
this
.
audioId
)
return
if
(
this
.
audioId
)
return
if
(
this
.
data
)
{
if
(
this
.
data
)
{
this
.
btnX
.
active
=
true
if
(
this
.
data
.
pic_url
&&
this
.
data
.
gIdx
==
0
)
{
if
(
this
.
data
.
pic_url
&&
this
.
data
.
gIdx
==
0
)
{
tools
.
getSpriteFrimeByUrl
(
this
.
data
.
pic_url
,
(
sp
)
=>
{
tools
.
getSpriteFrimeByUrl
(
this
.
data
.
pic_url
,
(
sp
)
=>
{
this
.
sprite
.
spriteFrame
=
sp
this
.
sprite
.
spriteFrame
=
sp
...
@@ -89,9 +92,15 @@ cc.Class({
...
@@ -89,9 +92,15 @@ cc.Class({
}
}
},
},
onClickHide
()
{
this
.
sprite
.
node
.
active
=
false
this
.
hideBox
()
},
/**隐藏边框 */
/**隐藏边框 */
hideBox
()
{
hideBox
()
{
this
.
quan
.
active
=
false
this
.
quan
.
active
=
false
this
.
btnX
.
active
=
false
this
.
stopAudio
()
this
.
stopAudio
()
},
},
...
...
This diff is collapsed.
Click to expand it.
play/assets/scene/textures/btn_x.png
0 → 100644
View file @
d73a4299
2.17 KB
This diff is collapsed.
Click to expand it.
play/assets/scene/textures/btn_x.png.meta
0 → 100644
View file @
d73a4299
{
"ver": "2.3.5",
"uuid": "617acbce-eb22-416b-b5d5-f1eaf7187ca9",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 34,
"height": 34,
"platformSettings": {},
"subMetas": {
"btn_x": {
"ver": "1.0.4",
"uuid": "b7316664-aba4-4008-a54a-11908a6c0b15",
"rawTextureUuid": "617acbce-eb22-416b-b5d5-f1eaf7187ca9",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 34,
"height": 34,
"rawWidth": 34,
"rawHeight": 34,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment