Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
duiduipeng
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
duiduipeng
Commits
54d79795
Commit
54d79795
authored
Apr 23, 2022
by
章红平
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交
parent
b0043bb5
Changes
18
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
582 additions
and
141 deletions
+582
-141
time1.mp3
assets/duiduipeng/audios/time1.mp3
+0
-0
time1.mp3.meta
assets/duiduipeng/audios/time1.mp3.meta
+0
-0
time2.mp3
assets/duiduipeng/audios/time2.mp3
+0
-0
time2.mp3.meta
assets/duiduipeng/audios/time2.mp3.meta
+0
-0
choose.ttf
assets/duiduipeng/fonts/choose.ttf
+0
-0
choose.ttf.meta
assets/duiduipeng/fonts/choose.ttf.meta
+0
-0
1.png
assets/duiduipeng/newTextures/1.png
+0
-0
1.png.meta
assets/duiduipeng/newTextures/1.png.meta
+1
-1
2.png
assets/duiduipeng/newTextures/2.png
+0
-0
2.png.meta
assets/duiduipeng/newTextures/2.png.meta
+1
-1
3.png
assets/duiduipeng/newTextures/3.png
+0
-0
3.png.meta
assets/duiduipeng/newTextures/3.png.meta
+1
-1
card.prefab
assets/duiduipeng/newTextures/prefabs/card.prefab
+237
-29
card.ts
assets/duiduipeng/newTextures/prefabs/card.ts
+91
-0
card.ts.meta
assets/duiduipeng/newTextures/prefabs/card.ts.meta
+9
-0
duiduipeng.fire
assets/duiduipeng/scene/duiduipeng.fire
+160
-105
duiduipeng.ts
assets/duiduipeng/scene/duiduipeng.ts
+73
-4
MyCocosSceneComponent.ts
assets/duiduipeng/script/MyCocosSceneComponent.ts
+9
-0
No files found.
assets/duiduipeng/audios/
倒计时
1.mp3
→
assets/duiduipeng/audios/
time
1.mp3
View file @
54d79795
File moved
assets/duiduipeng/audios/
倒计时
1.mp3.meta
→
assets/duiduipeng/audios/
time
1.mp3.meta
View file @
54d79795
File moved
assets/duiduipeng/audios/
倒计时5-
2.mp3
→
assets/duiduipeng/audios/
time
2.mp3
View file @
54d79795
File moved
assets/duiduipeng/audios/
倒计时5-
2.mp3.meta
→
assets/duiduipeng/audios/
time
2.mp3.meta
View file @
54d79795
File moved
assets/duiduipeng/fonts/
选项
.ttf
→
assets/duiduipeng/fonts/
choose
.ttf
View file @
54d79795
File moved
assets/duiduipeng/fonts/
选项
.ttf.meta
→
assets/duiduipeng/fonts/
choose
.ttf.meta
View file @
54d79795
File moved
assets/duiduipeng/newTextures/
text_
1.png
→
assets/duiduipeng/newTextures/1.png
View file @
54d79795
File moved
assets/duiduipeng/newTextures/
text_
1.png.meta
→
assets/duiduipeng/newTextures/1.png.meta
View file @
54d79795
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
"height": 162,
"height": 162,
"platformSettings": {},
"platformSettings": {},
"subMetas": {
"subMetas": {
"
text_
1": {
"1": {
"ver": "1.0.4",
"ver": "1.0.4",
"uuid": "9f2bff18-673d-4254-bfcf-8e67c6d62390",
"uuid": "9f2bff18-673d-4254-bfcf-8e67c6d62390",
"rawTextureUuid": "32700d1f-9b5c-4576-8cd1-4061ed58ec0b",
"rawTextureUuid": "32700d1f-9b5c-4576-8cd1-4061ed58ec0b",
...
...
assets/duiduipeng/newTextures/
text_
2.png
→
assets/duiduipeng/newTextures/2.png
View file @
54d79795
File moved
assets/duiduipeng/newTextures/
text_
2.png.meta
→
assets/duiduipeng/newTextures/2.png.meta
View file @
54d79795
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
"height": 162,
"height": 162,
"platformSettings": {},
"platformSettings": {},
"subMetas": {
"subMetas": {
"
text_
2": {
"2": {
"ver": "1.0.4",
"ver": "1.0.4",
"uuid": "1baedfc5-f574-4b96-8f28-4a9bde529f34",
"uuid": "1baedfc5-f574-4b96-8f28-4a9bde529f34",
"rawTextureUuid": "ff5fe14e-6b94-4529-84a3-e3b68a2a2f3a",
"rawTextureUuid": "ff5fe14e-6b94-4529-84a3-e3b68a2a2f3a",
...
...
assets/duiduipeng/newTextures/
text_
3.png
→
assets/duiduipeng/newTextures/3.png
View file @
54d79795
File moved
assets/duiduipeng/newTextures/
text_
3.png.meta
→
assets/duiduipeng/newTextures/3.png.meta
View file @
54d79795
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
"height": 162,
"height": 162,
"platformSettings": {},
"platformSettings": {},
"subMetas": {
"subMetas": {
"
text_
3": {
"3": {
"ver": "1.0.4",
"ver": "1.0.4",
"uuid": "bfe5075f-6f40-406c-bcfb-3d53ce1c4301",
"uuid": "bfe5075f-6f40-406c-bcfb-3d53ce1c4301",
"rawTextureUuid": "1061fa95-0194-4b25-a29b-e8ad794fde0f",
"rawTextureUuid": "1061fa95-0194-4b25-a29b-e8ad794fde0f",
...
...
assets/duiduipeng/newTextures/prefabs/card.prefab
View file @
54d79795
...
@@ -21,16 +21,23 @@
...
@@ -21,16 +21,23 @@
"__id__": 2
"__id__": 2
},
},
{
{
"__id__":
5
"__id__":
8
},
},
{
{
"__id__":
8
"__id__":
11
}
}
],
],
"_active": true,
"_active": true,
"_components": [],
"_components": [
{
"__id__": 14
},
{
"__id__": 15
}
],
"_prefab": {
"_prefab": {
"__id__": 1
1
"__id__": 1
6
},
},
"_opacity": 255,
"_opacity": 255,
"_color": {
"_color": {
...
@@ -86,15 +93,19 @@
...
@@ -86,15 +93,19 @@
"_parent": {
"_parent": {
"__id__": 1
"__id__": 1
},
},
"_children": [],
"_children": [
{
"__id__": 3
}
],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__":
3
"__id__":
6
}
}
],
],
"_prefab": {
"_prefab": {
"__id__":
4
"__id__":
7
},
},
"_opacity": 255,
"_opacity": 255,
"_color": {
"_color": {
...
@@ -143,6 +154,116 @@
...
@@ -143,6 +154,116 @@
"groupIndex": 0,
"groupIndex": 0,
"_id": ""
"_id": ""
},
},
{
"__type__": "cc.Node",
"_name": "New Label",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 4
}
],
"_prefab": {
"__id__": 5
},
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 95,
"g": 207,
"b": 208,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 200,
"height": 75.6
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
0,
0,
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.Label",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 3
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_string": "candi",
"_N$string": "candi",
"_fontSize": 60,
"_lineHeight": 60,
"_enableWrapText": true,
"_N$file": {
"__uuid__": "06add093-9d94-4388-b544-1b2ad59b5bc1"
},
"_isSystemFontUsed": false,
"_spacingX": 0,
"_batchAsBitmap": false,
"_styleFlags": 0,
"_underlineHeight": 0,
"_N$horizontalAlign": 1,
"_N$verticalAlign": 1,
"_N$fontFamily": "Arial",
"_N$overflow": 2,
"_N$cacheMode": 0,
"_id": ""
},
{
"__type__": "cc.PrefabInfo",
"root": {
"__id__": 1
},
"asset": {
"__uuid__": "282fcbdc-d3bf-489b-84b9-56358c5441cb"
},
"fileId": "35WowoHDhEPajiTVLzQCcE",
"sync": false
},
{
{
"__type__": "cc.Sprite",
"__type__": "cc.Sprite",
"_name": "",
"_name": "",
...
@@ -181,14 +302,14 @@
...
@@ -181,14 +302,14 @@
"__id__": 1
"__id__": 1
},
},
"asset": {
"asset": {
"__
id__": 0
"__
uuid__": "282fcbdc-d3bf-489b-84b9-56358c5441cb"
},
},
"fileId": "95FDfbQWNPlq3fq4wYlTU1",
"fileId": "95FDfbQWNPlq3fq4wYlTU1",
"sync": false
"sync": false
},
},
{
{
"__type__": "cc.Node",
"__type__": "cc.Node",
"_name": "
bg_crad-back
",
"_name": "
icon
",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 1
"__id__": 1
...
@@ -197,11 +318,11 @@
...
@@ -197,11 +318,11 @@
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__":
6
"__id__":
9
}
}
],
],
"_prefab": {
"_prefab": {
"__id__":
7
"__id__":
10
},
},
"_opacity": 255,
"_opacity": 255,
"_color": {
"_color": {
...
@@ -213,8 +334,8 @@
...
@@ -213,8 +334,8 @@
},
},
"_contentSize": {
"_contentSize": {
"__type__": "cc.Size",
"__type__": "cc.Size",
"width": 2
4
0,
"width": 2
0
0,
"height": 2
75
"height": 2
40
},
},
"_anchorPoint": {
"_anchorPoint": {
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
...
@@ -255,7 +376,7 @@
...
@@ -255,7 +376,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__":
5
"__id__":
8
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -265,9 +386,7 @@
...
@@ -265,9 +386,7 @@
],
],
"_srcBlendFactor": 770,
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_dstBlendFactor": 771,
"_spriteFrame": {
"_spriteFrame": null,
"__uuid__": "efba3d4a-b76a-4eda-a65e-aa26f2357439"
},
"_type": 0,
"_type": 0,
"_sizeMode": 1,
"_sizeMode": 1,
"_fillType": 0,
"_fillType": 0,
...
@@ -288,14 +407,14 @@
...
@@ -288,14 +407,14 @@
"__id__": 1
"__id__": 1
},
},
"asset": {
"asset": {
"__
id__": 0
"__
uuid__": "282fcbdc-d3bf-489b-84b9-56358c5441cb"
},
},
"fileId": "
c1uv2eSUhO7ZDzrM1TwY8H
",
"fileId": "
71cqV8SNdEabf5k+v4MPPK
",
"sync": false
"sync": false
},
},
{
{
"__type__": "cc.Node",
"__type__": "cc.Node",
"_name": "
icon
",
"_name": "
bg_crad-back
",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 1
"__id__": 1
...
@@ -304,11 +423,11 @@
...
@@ -304,11 +423,11 @@
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__":
9
"__id__":
12
}
}
],
],
"_prefab": {
"_prefab": {
"__id__": 1
0
"__id__": 1
3
},
},
"_opacity": 255,
"_opacity": 255,
"_color": {
"_color": {
...
@@ -320,8 +439,8 @@
...
@@ -320,8 +439,8 @@
},
},
"_contentSize": {
"_contentSize": {
"__type__": "cc.Size",
"__type__": "cc.Size",
"width":
10
0,
"width":
24
0,
"height":
100
"height":
275
},
},
"_anchorPoint": {
"_anchorPoint": {
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
...
@@ -362,7 +481,7 @@
...
@@ -362,7 +481,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__":
8
"__id__":
11
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -372,7 +491,9 @@
...
@@ -372,7 +491,9 @@
],
],
"_srcBlendFactor": 770,
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_dstBlendFactor": 771,
"_spriteFrame": null,
"_spriteFrame": {
"__uuid__": "efba3d4a-b76a-4eda-a65e-aa26f2357439"
},
"_type": 0,
"_type": 0,
"_sizeMode": 1,
"_sizeMode": 1,
"_fillType": 0,
"_fillType": 0,
...
@@ -393,18 +514,105 @@
...
@@ -393,18 +514,105 @@
"__id__": 1
"__id__": 1
},
},
"asset": {
"asset": {
"__
id__": 0
"__
uuid__": "282fcbdc-d3bf-489b-84b9-56358c5441cb"
},
},
"fileId": "
71cqV8SNdEabf5k+v4MPPK
",
"fileId": "
c1uv2eSUhO7ZDzrM1TwY8H
",
"sync": false
"sync": false
},
},
{
"__type__": "930ecDU5FRJxY/bSPjAYqS3",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
},
"_enabled": true,
"iconN": {
"__id__": 8
},
"backN": {
"__id__": 11
},
"wordLabel": {
"__id__": 4
},
"_id": ""
},
{
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 1
},
"_enabled": true,
"_normalMaterial": null,
"_grayMaterial": null,
"duration": 0.1,
"zoomScale": 1.2,
"clickEvents": [],
"_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.PrefabInfo",
"__type__": "cc.PrefabInfo",
"root": {
"root": {
"__id__": 1
"__id__": 1
},
},
"asset": {
"asset": {
"__
id__": 0
"__
uuid__": "282fcbdc-d3bf-489b-84b9-56358c5441cb"
},
},
"fileId": "",
"fileId": "",
"sync": false
"sync": false
...
...
assets/duiduipeng/newTextures/prefabs/card.ts
0 → 100644
View file @
54d79795
// Learn TypeScript:
// - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
// Learn Attribute:
// - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
// - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
const
{
ccclass
,
property
}
=
cc
.
_decorator
;
import
SceneComponent
from
"
../../scene/duiduipeng
"
;
@
ccclass
export
default
class
card
extends
cc
.
Component
{
@
property
(
cc
.
Node
)
iconN
:
cc
.
Node
=
null
;
@
property
(
cc
.
Node
)
backN
:
cc
.
Node
=
null
;
@
property
(
cc
.
Label
)
wordLabel
:
cc
.
Label
=
null
;
mainControl
:
SceneComponent
=
null
;
data
=
null
// LIFE-CYCLE CALLBACKS:
// onLoad () {}
start
()
{
this
.
node
.
on
(
"
click
"
,()
=>
{
this
.
doFlip
()
})
}
initData
(
data
,
mainControl
){
this
.
data
=
data
;
this
.
mainControl
=
mainControl
this
.
node
.
off
(
"
click
"
)
this
.
node
.
on
(
"
click
"
,()
=>
{
this
.
doFlip
()
})
this
.
updateBtnAble
(
false
);
if
(
this
.
data
.
type
==
"
img
"
){
this
.
iconN
.
active
=
true
;
this
.
iconN
.
scaleX
=
1
this
.
mainControl
.
getSprForNodeByUrl
(
this
.
data
.
image
,
this
.
iconN
,()
=>
{
if
(
this
.
iconN
.
width
/
this
.
iconN
.
height
>
200
/
240
){
this
.
iconN
.
scale
=
200
/
this
.
iconN
.
width
}
else
{
this
.
iconN
.
scale
=
240
/
this
.
iconN
.
height
}
});
this
.
wordLabel
.
string
=
""
}
else
{
this
.
wordLabel
.
node
.
scaleX
=
1
this
.
wordLabel
.
string
=
this
.
data
.
text
}
}
updateBtnAble
(
interactable
){
this
.
node
.
getComponent
(
cc
.
Button
).
interactable
=
interactable
;
}
doFlip
(
cb
=
null
){
this
.
node
.
stopAllActions
();
if
(
this
.
node
.
scaleX
>
0
){
cc
.
tween
(
this
.
node
)
.
to
(
0.25
,{
scaleX
:
0
})
.
call
(()
=>
{
this
.
iconN
.
scaleX
=-
this
.
iconN
.
scaleX
this
.
wordLabel
.
node
.
scaleX
=-
1
this
.
backN
.
active
=
false
})
.
to
(
0.25
,{
scaleX
:
-
1
})
.
start
();
}
else
{
cc
.
tween
(
this
.
node
)
.
to
(
0.25
,{
scaleX
:
0
})
.
call
(()
=>
{
this
.
iconN
.
scaleX
=-
this
.
iconN
.
scaleX
this
.
wordLabel
.
node
.
scaleX
=
1
this
.
backN
.
active
=
true
})
.
to
(
0.25
,{
scaleX
:
1
})
.
start
();
}
}
// update (dt) {}
}
assets/duiduipeng/newTextures/prefabs/card.ts.meta
0 → 100644
View file @
54d79795
{
"ver": "1.0.8",
"uuid": "930ec0d4-e454-49c5-8fdb-48f8c062a4b7",
"isPlugin": false,
"loadPluginInWeb": true,
"loadPluginInNative": true,
"loadPluginInEditor": false,
"subMetas": {}
}
\ No newline at end of file
assets/duiduipeng/scene/duiduipeng.fire
View file @
54d79795
...
@@ -78,22 +78,22 @@
...
@@ -78,22 +78,22 @@
"__id__": 9
"__id__": 9
},
},
{
{
"__id__": 9
8
"__id__": 9
9
},
},
{
{
"__id__": 10
8
"__id__": 10
9
}
}
],
],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
"__id__": 110
},
{
{
"__id__": 111
"__id__": 111
},
},
{
{
"__id__": 112
"__id__": 112
},
{
"__id__": 113
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -459,15 +459,12 @@
...
@@ -459,15 +459,12 @@
},
},
{
{
"__id__": 86
"__id__": 86
},
{
"__id__": 95
}
}
],
],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 9
7
"__id__": 9
8
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -3533,13 +3530,16 @@
...
@@ -3533,13 +3530,16 @@
"__id__": 87
"__id__": 87
},
},
{
{
"__id__": 90
"__id__": 89
},
{
"__id__": 93
}
}
],
],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 9
4
"__id__": 9
7
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -3602,9 +3602,6 @@
...
@@ -3602,9 +3602,6 @@
"_components": [
"_components": [
{
{
"__id__": 88
"__id__": 88
},
{
"__id__": 89
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -3618,8 +3615,8 @@
...
@@ -3618,8 +3615,8 @@
},
},
"_contentSize": {
"_contentSize": {
"__type__": "cc.Size",
"__type__": "cc.Size",
"width":
1334
,
"width":
3000
,
"height":
75
0
"height":
300
0
},
},
"_anchorPoint": {
"_anchorPoint": {
"__type__": "cc.Vec2",
"__type__": "cc.Vec2",
...
@@ -3687,35 +3684,6 @@
...
@@ -3687,35 +3684,6 @@
"_atlas": null,
"_atlas": null,
"_id": "e3Yed2G8tG4rTUdRGr4MSH"
"_id": "e3Yed2G8tG4rTUdRGr4MSH"
},
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 87
},
"_enabled": true,
"alignMode": 2,
"_target": {
"__id__": 2
},
"_alignFlags": 45,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 862,
"_originalHeight": 370,
"_id": "bcCSVhd2BIkYX6O9qFINI/"
},
{
{
"__type__": "cc.Node",
"__type__": "cc.Node",
"_name": "bg_tip",
"_name": "bg_tip",
...
@@ -3725,13 +3693,13 @@
...
@@ -3725,13 +3693,13 @@
},
},
"_children": [
"_children": [
{
{
"__id__": 9
1
"__id__": 9
0
}
}
],
],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 9
3
"__id__": 9
2
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -3787,13 +3755,13 @@
...
@@ -3787,13 +3755,13 @@
"_name": "New Label",
"_name": "New Label",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__":
90
"__id__":
89
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 9
2
"__id__": 9
1
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -3849,7 +3817,7 @@
...
@@ -3849,7 +3817,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 9
1
"__id__": 9
0
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -3884,7 +3852,7 @@
...
@@ -3884,7 +3852,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__":
90
"__id__":
89
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -3911,45 +3879,21 @@
...
@@ -3911,45 +3879,21 @@
"_atlas": null,
"_atlas": null,
"_id": "4e7eA4mRJG46NUSjaqUBu8"
"_id": "4e7eA4mRJG46NUSjaqUBu8"
},
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 86
},
"_enabled": true,
"alignMode": 2,
"_target": null,
"_alignFlags": 45,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 862,
"_originalHeight": 370,
"_id": "f0zHqN8m9O1b7HYVbbjr+i"
},
{
{
"__type__": "cc.Node",
"__type__": "cc.Node",
"_name": "btn_start",
"_name": "btn_start",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__":
9
"__id__":
86
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 96
"__id__": 94
},
{
"__id__": 95
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -3976,7 +3920,7 @@
...
@@ -3976,7 +3920,7 @@
"ctor": "Float64Array",
"ctor": "Float64Array",
"array": [
"array": [
0,
0,
-1
49.454
,
-1
87.688
,
0,
0,
0,
0,
0,
0,
...
@@ -3984,7 +3928,7 @@
...
@@ -3984,7 +3928,7 @@
1,
1,
1,
1,
1,
1,
1
0
]
]
},
},
"_eulerAngles": {
"_eulerAngles": {
...
@@ -4005,7 +3949,7 @@
...
@@ -4005,7 +3949,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 9
5
"__id__": 9
3
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -4032,6 +3976,115 @@
...
@@ -4032,6 +3976,115 @@
"_atlas": null,
"_atlas": null,
"_id": "365zF3jo5OCLkvdSjBXzhu"
"_id": "365zF3jo5OCLkvdSjBXzhu"
},
},
{
"__type__": "cc.Button",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 93
},
"_enabled": true,
"_normalMaterial": null,
"_grayMaterial": null,
"duration": 0.1,
"zoomScale": 1.2,
"clickEvents": [
{
"__id__": 96
}
],
"_N$interactable": true,
"_N$enableAutoGrayEffect": false,
"_N$transition": 3,
"transition": 3,
"_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": "aaUlu0oxtL8bqQX0S9kexa"
},
{
"__type__": "cc.ClickEvent",
"target": {
"__id__": 2
},
"component": "",
"_componentId": "408a6f4ZfpM8Yzyg+IOGg/V",
"handler": "onStartClick",
"customEventData": ""
},
{
"__type__": "cc.Widget",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 86
},
"_enabled": true,
"alignMode": 2,
"_target": null,
"_alignFlags": 45,
"_left": 0,
"_right": 0,
"_top": 0,
"_bottom": 0,
"_verticalCenter": 0,
"_horizontalCenter": 0,
"_isAbsLeft": true,
"_isAbsRight": true,
"_isAbsTop": true,
"_isAbsBottom": true,
"_isAbsHorizontalCenter": true,
"_isAbsVerticalCenter": true,
"_originalWidth": 862,
"_originalHeight": 370,
"_id": "f0zHqN8m9O1b7HYVbbjr+i"
},
{
{
"__type__": "cc.Mask",
"__type__": "cc.Mask",
"_name": "",
"_name": "",
...
@@ -4061,13 +4114,13 @@
...
@@ -4061,13 +4114,13 @@
},
},
"_children": [
"_children": [
{
{
"__id__":
99
"__id__":
100
},
},
{
{
"__id__": 10
2
"__id__": 10
3
},
},
{
{
"__id__": 10
5
"__id__": 10
6
}
}
],
],
"_active": false,
"_active": false,
...
@@ -4125,11 +4178,11 @@
...
@@ -4125,11 +4178,11 @@
"_name": "font",
"_name": "font",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 9
8
"__id__": 9
9
},
},
"_children": [
"_children": [
{
{
"__id__": 10
0
"__id__": 10
1
}
}
],
],
"_active": true,
"_active": true,
...
@@ -4187,13 +4240,13 @@
...
@@ -4187,13 +4240,13 @@
"_name": "BRLNSDB",
"_name": "BRLNSDB",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__":
99
"__id__":
100
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 10
1
"__id__": 10
2
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -4249,7 +4302,7 @@
...
@@ -4249,7 +4302,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 10
0
"__id__": 10
1
},
},
"_enabled": true,
"_enabled": true,
"_materials": [],
"_materials": [],
...
@@ -4280,11 +4333,11 @@
...
@@ -4280,11 +4333,11 @@
"_name": "img",
"_name": "img",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 9
8
"__id__": 9
9
},
},
"_children": [
"_children": [
{
{
"__id__": 10
3
"__id__": 10
4
}
}
],
],
"_active": true,
"_active": true,
...
@@ -4342,13 +4395,13 @@
...
@@ -4342,13 +4395,13 @@
"_name": "icon",
"_name": "icon",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 10
2
"__id__": 10
3
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 10
4
"__id__": 10
5
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -4404,7 +4457,7 @@
...
@@ -4404,7 +4457,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 10
3
"__id__": 10
4
},
},
"_enabled": true,
"_enabled": true,
"_materials": [],
"_materials": [],
...
@@ -4432,11 +4485,11 @@
...
@@ -4432,11 +4485,11 @@
"_name": "audio",
"_name": "audio",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 9
8
"__id__": 9
9
},
},
"_children": [
"_children": [
{
{
"__id__": 10
6
"__id__": 10
7
}
}
],
],
"_active": true,
"_active": true,
...
@@ -4494,13 +4547,13 @@
...
@@ -4494,13 +4547,13 @@
"_name": "btn",
"_name": "btn",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 10
5
"__id__": 10
6
},
},
"_children": [],
"_children": [],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 10
7
"__id__": 10
8
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -4556,7 +4609,7 @@
...
@@ -4556,7 +4609,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 10
6
"__id__": 10
7
},
},
"_enabled": true,
"_enabled": true,
"_clip": {
"_clip": {
...
@@ -4581,7 +4634,7 @@
...
@@ -4581,7 +4634,7 @@
"_active": false,
"_active": false,
"_components": [
"_components": [
{
{
"__id__": 1
09
"__id__": 1
10
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -4637,7 +4690,7 @@
...
@@ -4637,7 +4690,7 @@
"_name": "",
"_name": "",
"_objFlags": 0,
"_objFlags": 0,
"node": {
"node": {
"__id__": 10
8
"__id__": 10
9
},
},
"_enabled": true,
"_enabled": true,
"_materials": [
"_materials": [
...
@@ -4726,9 +4779,11 @@
...
@@ -4726,9 +4779,11 @@
"__id__": 28
"__id__": 28
},
},
"tipLabel": {
"tipLabel": {
"__id__": 92
"__id__": 91
},
"tipN": {
"__id__": 86
},
},
"tipN": null,
"_id": "eaTVUpqahPfZeO9+sUI7RP"
"_id": "eaTVUpqahPfZeO9+sUI7RP"
}
}
]
]
\ No newline at end of file
assets/duiduipeng/scene/duiduipeng.ts
View file @
54d79795
...
@@ -15,8 +15,15 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -15,8 +15,15 @@ export default class SceneComponent extends MyCocosSceneComponent {
tipLabel
:
cc
.
Label
=
null
tipLabel
:
cc
.
Label
=
null
@
property
(
cc
.
Node
)
@
property
(
cc
.
Node
)
tipN
:
cc
.
Node
=
null
tipN
:
cc
.
Node
=
null
@
property
(
cc
.
Node
)
countDown
:
cc
.
Node
=
null
;
questionIndex
=
0
;
questionIndex
=
0
;
gameState
=
"
watching
"
gameState
=
"
watching
"
watchInterval
=
null
;
gameInterval
=
null
;
watchTime
=
null
;
gameTime
=
null
;
...
@@ -62,7 +69,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -62,7 +69,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
cc
.
find
(
'
Canvas/uiP
'
).
scale
=
this
.
_mapScaleMin
;
cc
.
find
(
'
Canvas/uiP
'
).
scale
=
this
.
_mapScaleMin
;
}
}
initCards
()
{
initCards
()
{
let
num
=
4
;
let
data
=
this
.
getRandomCardData
();
let
num
=
data
.
length
;
this
.
cardParentN
.
removeAllChildren
();
this
.
cardParentN
.
removeAllChildren
();
let
col
=
Math
.
ceil
(
num
/
2
);
let
col
=
Math
.
ceil
(
num
/
2
);
let
width
=
1250
;
let
width
=
1250
;
...
@@ -79,6 +87,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -79,6 +87,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
else
{
}
else
{
card
.
y
=
+
card
.
height
/
2
+
10
card
.
y
=
+
card
.
height
/
2
+
10
}
}
card
.
getComponent
(
"
card
"
).
initData
(
data
[
i
],
this
)
}
}
}
else
if
(
col
==
2
)
{
}
else
if
(
col
==
2
)
{
...
@@ -97,6 +106,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -97,6 +106,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
else
{
}
else
{
card
.
y
=
+
card
.
height
/
2
+
10
card
.
y
=
+
card
.
height
/
2
+
10
}
}
card
.
getComponent
(
"
card
"
).
initData
(
data
[
i
],
this
)
}
}
}
else
{
}
else
{
...
@@ -109,6 +119,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -109,6 +119,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
else
{
}
else
{
card
.
y
=
+
card
.
height
/
2
+
10
card
.
y
=
+
card
.
height
/
2
+
10
}
}
card
.
getComponent
(
"
card
"
).
initData
(
data
[
i
],
this
)
}
}
}
}
}
}
...
@@ -127,15 +138,73 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -127,15 +138,73 @@ export default class SceneComponent extends MyCocosSceneComponent {
initTime
(){
initTime
(){
let
timeN
=
cc
.
find
(
"
Canvas/uiP/timeN/bg_time
"
);
let
timeN
=
cc
.
find
(
"
Canvas/uiP/timeN/bg_time
"
);
let
timeN1
=
cc
.
find
(
"
Canvas/uiP/timeN/bg_time2
"
);
let
timeN1
=
cc
.
find
(
"
Canvas/uiP/timeN/bg_time2
"
);
let
numTime
=
this
.
data
.
questions
[
0
].
watchTime
;
this
.
watchTime
=
this
.
data
.
questions
[
0
].
watchTime
;
if
(
this
.
gameState
==
"
game
"
)
numTime
=
this
.
data
.
questions
[
0
].
gameTime
;
this
.
gameTime
=
this
.
data
.
questions
[
0
].
gameTime
;
timeN
.
getComponentInChildren
(
cc
.
Label
).
string
=
this
.
data
.
numTime
;
let
numTime
=
this
.
watchTime
;
if
(
this
.
gameState
==
"
game
"
)
numTime
=
this
.
gameTime
;
timeN
.
getComponentInChildren
(
cc
.
Label
).
string
=
numTime
;
timeN
.
active
=
true
;
timeN
.
active
=
true
;
timeN1
.
active
=
false
;
timeN1
.
active
=
false
;
}
}
updateTime
(){
updateTime
(){
let
timeN
=
cc
.
find
(
"
Canvas/uiP/timeN/bg_time
"
);
let
timeN1
=
cc
.
find
(
"
Canvas/uiP/timeN/bg_time2
"
);
let
numTime
=
this
.
watchTime
;
if
(
this
.
gameState
==
"
game
"
)
numTime
=
this
.
gameTime
;
timeN
.
getComponentInChildren
(
cc
.
Label
).
string
=
numTime
;
timeN1
.
getComponentInChildren
(
cc
.
Label
).
string
=
numTime
;
timeN
.
active
=
true
;
timeN1
.
active
=
false
;
if
(
numTime
<=
5
){
timeN
.
active
=
false
;
timeN1
.
active
=
true
;
if
(
numTime
<=
1
){
if
(
numTime
==
1
)
this
.
playLocalAudio
(
"
time1
"
)
}
else
{
this
.
playLocalAudio
(
"
time2
"
)
}
if
(
this
.
gameState
==
"
watching
"
){
if
(
numTime
==
1
||
numTime
==
2
||
numTime
==
3
){
}
}
}
}
}
onStartClick
(){
this
.
tipN
.
active
=
false
;
this
.
playLocalAudio
(
"
btn
"
);
let
children
=
this
.
cardParentN
.
children
;
for
(
let
i
=
0
;
i
<
children
.
length
;
i
++
){
children
[
i
].
getComponent
(
"
card
"
).
doFlip
(()
=>
{
})
}
}
startWatch
(){
this
.
gameState
==
"
watching
"
this
.
initTime
();
this
.
clearntervals
();
this
.
watchInterval
=
setInterval
(()
=>
{
this
.
watchTime
--
;
if
(
this
.
watchTime
<=
0
){
this
.
clearntervals
();
}
this
.
updateTime
();
},
1000
)
};
clearntervals
(){
if
(
this
.
watchInterval
){
clearInterval
(
this
.
watchInterval
);
}
if
(
this
.
gameInterval
){
clearInterval
(
this
.
gameInterval
);
}
}
initView
()
{
initView
()
{
...
...
assets/duiduipeng/script/MyCocosSceneComponent.ts
View file @
54d79795
...
@@ -161,6 +161,15 @@ export class MyCocosSceneComponent extends cc.Component {
...
@@ -161,6 +161,15 @@ export class MyCocosSceneComponent extends cc.Component {
}
}
})
})
}
}
getSprForNodeByUrl
(
url
,
node
,
cb
=
null
)
{
const
spr
=
node
.
getComponent
(
cc
.
Sprite
);
this
.
getSpriteFrimeByUrl
(
url
,
(
sf
)
=>
{
spr
.
spriteFrame
=
sf
;
if
(
cb
)
{
cb
();
}
})
}
playAudioByUrl
(
audio_url
,
cb
=
null
)
{
playAudioByUrl
(
audio_url
,
cb
=
null
)
{
if
(
audio_url
)
{
if
(
audio_url
)
{
...
...
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