Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cartoon_main
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
cartoon_main
Commits
e1287bad
Commit
e1287bad
authored
Aug 31, 2022
by
liujiangnan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 加音效
parent
b83c9a96
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
154 additions
and
3 deletions
+154
-3
cartoon_main.fire
assets/cartoon_main/scene/cartoon_main.fire
+149
-3
util.ts
assets/cartoon_main/script/util.ts
+5
-0
No files found.
assets/cartoon_main/scene/cartoon_main.fire
View file @
e1287bad
...
@@ -79,18 +79,21 @@
...
@@ -79,18 +79,21 @@
},
},
{
{
"__id__": 22
"__id__": 22
},
{
"__id__": 33
}
}
],
],
"_active": true,
"_active": true,
"_components": [
"_components": [
{
{
"__id__": 3
3
"__id__": 3
6
},
},
{
{
"__id__": 3
4
"__id__": 3
7
},
},
{
{
"__id__": 3
5
"__id__": 3
8
}
}
],
],
"_prefab": null,
"_prefab": null,
...
@@ -1547,6 +1550,149 @@
...
@@ -1547,6 +1550,149 @@
"_originalHeight": 0,
"_originalHeight": 0,
"_id": "b36Ubd5olJrpvGM0wzH0oD"
"_id": "b36Ubd5olJrpvGM0wzH0oD"
},
},
{
"__type__": "cc.Node",
"_name": "audio",
"_objFlags": 0,
"_parent": {
"__id__": 2
},
"_children": [
{
"__id__": 34
}
],
"_active": false,
"_components": [],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
},
"_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": "f91HKwauZLt51g7SWo6nMO"
},
{
"__type__": "cc.Node",
"_name": "btn",
"_objFlags": 0,
"_parent": {
"__id__": 33
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 35
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 0,
"height": 0
},
"_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": "3flu4UbJdBPK6Cbe2Wk5rz"
},
{
"__type__": "cc.AudioSource",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 34
},
"_enabled": true,
"_clip": {
"__uuid__": "77fede7e-1b07-44f7-b87d-4b576c476e14"
},
"_volume": 1,
"_mute": false,
"_loop": false,
"_firstlyEnabled": true,
"playOnLoad": false,
"preload": false,
"_id": "46FtHjay1M44bERqTxhOho"
},
{
{
"__type__": "cc.Canvas",
"__type__": "cc.Canvas",
"_name": "",
"_name": "",
...
...
assets/cartoon_main/script/util.ts
View file @
e1287bad
...
@@ -589,6 +589,11 @@ export function buttonOnClick(button: cc.Node, callback: Function, scale = 1.0)
...
@@ -589,6 +589,11 @@ export function buttonOnClick(button: cc.Node, callback: Function, scale = 1.0)
if
(
button
[
'
cantClick
'
])
{
if
(
button
[
'
cantClick
'
])
{
return
;
return
;
}
}
cc
.
audioEngine
.
stopAll
();
const
audio
=
cc
.
find
(
`Canvas/audio/btn`
).
getComponent
(
cc
.
AudioSource
);
cc
.
audioEngine
.
playEffect
(
audio
.
clip
,
false
);
button
[
'
cantClick
'
]
=
true
;
button
[
'
cantClick
'
]
=
true
;
cc
.
tween
(
button
)
cc
.
tween
(
button
)
.
to
(
0.1
,
{
scale
:
scale
*
1.1
})
.
to
(
0.1
,
{
scale
:
scale
*
1.1
})
...
...
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