Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sn09_xuanze
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
sn09_xuanze
Commits
1f2d842a
Commit
1f2d842a
authored
Sep 13, 2023
by
Tt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加音效点击效果
parent
936126a2
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
15 deletions
+39
-15
ImgVoice.ts
assets/sn05_night/scene/ImgVoice.ts
+1
-1
sn05_night.fire
assets/sn05_night/scene/sn05_night.fire
+14
-11
sn05_night.ts
assets/sn05_night/scene/sn05_night.ts
+24
-3
No files found.
assets/sn05_night/scene/ImgVoice.ts
View file @
1f2d842a
...
@@ -45,7 +45,7 @@ export default class ImgVoice extends cc.Component {
...
@@ -45,7 +45,7 @@ export default class ImgVoice extends cc.Component {
this
.
playVoiceCount
=
0
;
this
.
playVoiceCount
=
0
;
let
list
=
this
.
node
.
children
;
let
list
=
this
.
node
.
children
;
list
.
forEach
((
li
,
i
)
=>
{
list
.
forEach
((
li
,
i
)
=>
{
li
.
active
=
false
li
.
active
=
i
==
0
})
})
}
}
}
}
...
...
assets/sn05_night/scene/sn05_night.fire
View file @
1f2d842a
...
@@ -2056,13 +2056,13 @@
...
@@ -2056,13 +2056,13 @@
},
},
{
{
"__type__": "cc.Node",
"__type__": "cc.Node",
"_name": "icon_vioce
1
",
"_name": "icon_vioce
3
",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 41
"__id__": 41
},
},
"_children": [],
"_children": [],
"_active":
tru
e,
"_active":
fals
e,
"_components": [
"_components": [
{
{
"__id__": 43
"__id__": 43
...
@@ -2114,7 +2114,7 @@
...
@@ -2114,7 +2114,7 @@
"_is3DNode": false,
"_is3DNode": false,
"_groupIndex": 0,
"_groupIndex": 0,
"groupIndex": 0,
"groupIndex": 0,
"_id": "
bbPjdnqJFDrprJoheRfwmk
"
"_id": "
501OBejCFGAazbX9641Glz
"
},
},
{
{
"__type__": "cc.Sprite",
"__type__": "cc.Sprite",
...
@@ -2132,7 +2132,7 @@
...
@@ -2132,7 +2132,7 @@
"_srcBlendFactor": 770,
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_dstBlendFactor": 771,
"_spriteFrame": {
"_spriteFrame": {
"__uuid__": "
43b29bb7-6f39-4b2f-ad57-012c9666d70e
"
"__uuid__": "
c3c12d3b-e370-413a-acca-565a10fa453a
"
},
},
"_type": 0,
"_type": 0,
"_sizeMode": 1,
"_sizeMode": 1,
...
@@ -2146,7 +2146,7 @@
...
@@ -2146,7 +2146,7 @@
"_fillRange": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_isTrimmedMode": true,
"_atlas": null,
"_atlas": null,
"_id": "
1elU3fpixGNbe9Hm8ZzlP2
"
"_id": "
2dG9LKzvdEVrr5pG8l8Tkb
"
},
},
{
{
"__type__": "cc.Node",
"__type__": "cc.Node",
...
@@ -2156,7 +2156,7 @@
...
@@ -2156,7 +2156,7 @@
"__id__": 41
"__id__": 41
},
},
"_children": [],
"_children": [],
"_active":
tru
e,
"_active":
fals
e,
"_components": [
"_components": [
{
{
"__id__": 45
"__id__": 45
...
@@ -2244,13 +2244,13 @@
...
@@ -2244,13 +2244,13 @@
},
},
{
{
"__type__": "cc.Node",
"__type__": "cc.Node",
"_name": "icon_vioce
3
",
"_name": "icon_vioce
1
",
"_objFlags": 0,
"_objFlags": 0,
"_parent": {
"_parent": {
"__id__": 41
"__id__": 41
},
},
"_children": [],
"_children": [],
"_active":
tru
e,
"_active":
fals
e,
"_components": [
"_components": [
{
{
"__id__": 47
"__id__": 47
...
@@ -2302,7 +2302,7 @@
...
@@ -2302,7 +2302,7 @@
"_is3DNode": false,
"_is3DNode": false,
"_groupIndex": 0,
"_groupIndex": 0,
"groupIndex": 0,
"groupIndex": 0,
"_id": "
501OBejCFGAazbX9641Glz
"
"_id": "
bbPjdnqJFDrprJoheRfwmk
"
},
},
{
{
"__type__": "cc.Sprite",
"__type__": "cc.Sprite",
...
@@ -2320,7 +2320,7 @@
...
@@ -2320,7 +2320,7 @@
"_srcBlendFactor": 770,
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_dstBlendFactor": 771,
"_spriteFrame": {
"_spriteFrame": {
"__uuid__": "
c3c12d3b-e370-413a-acca-565a10fa453a
"
"__uuid__": "
43b29bb7-6f39-4b2f-ad57-012c9666d70e
"
},
},
"_type": 0,
"_type": 0,
"_sizeMode": 1,
"_sizeMode": 1,
...
@@ -2334,7 +2334,7 @@
...
@@ -2334,7 +2334,7 @@
"_fillRange": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_isTrimmedMode": true,
"_atlas": null,
"_atlas": null,
"_id": "
2dG9LKzvdEVrr5pG8l8Tkb
"
"_id": "
1elU3fpixGNbe9Hm8ZzlP2
"
},
},
{
{
"__type__": "cc.Widget",
"__type__": "cc.Widget",
...
@@ -3390,6 +3390,9 @@
...
@@ -3390,6 +3390,9 @@
"__id__": 2
"__id__": 2
},
},
"_enabled": true,
"_enabled": true,
"btn_voice": {
"__id__": 41
},
"_id": "eaTVUpqahPfZeO9+sUI7RP"
"_id": "eaTVUpqahPfZeO9+sUI7RP"
}
}
]
]
\ No newline at end of file
assets/sn05_night/scene/sn05_night.ts
View file @
1f2d842a
...
@@ -56,6 +56,23 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -56,6 +56,23 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
}
initView
()
{
}
initView
()
{
}
initEvent
()
{
initEvent
()
{
pg
.
view
.
touchOn
(
this
.
btn_voice
,
this
.
onTouchVoice
,
this
);
}
private
audioId
:
any
;
onTouchVoice
()
{
if
(
!
this
.
canTouch
)
return
;
if
(
this
.
audioId
)
{
cc
.
audioEngine
.
stopEffect
(
this
.
audioId
);
this
.
btn_voice
.
getComponent
(
ImgVoice
).
playVoiceEnd
();
}
this
.
btn_voice
.
getComponent
(
ImgVoice
).
playVoiceStart
();
pg
.
audio
.
playAudioByUrl
(
this
.
currentQuestion
.
questionAudio
,
()
=>
{
this
.
audioId
=
null
;
this
.
btn_voice
.
getComponent
(
ImgVoice
).
playVoiceEnd
();
this
.
startCreate
=
true
;
},
audioId
=>
{
this
.
audioId
=
audioId
;
})
}
}
resetView
()
{
};
resetView
()
{
};
...
@@ -121,13 +138,17 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -121,13 +138,17 @@ export default class SceneComponent extends MyCocosSceneComponent {
pg
.
view
.
find
(
this
,
'
layer_game/layer_paopao
'
).
removeAllChildren
();
pg
.
view
.
find
(
this
,
'
layer_game/layer_paopao
'
).
removeAllChildren
();
this
.
startQuestion
();
this
.
startQuestion
();
this
.
btn_voice
.
getComponent
(
ImgVoice
).
playVoiceStart
();
pg
.
audio
.
playAudioByUrl
(
this
.
currentQuestion
.
questionAudio
).
then
(()
=>
{
pg
.
audio
.
playAudioByUrl
(
this
.
currentQuestion
.
questionAudio
).
then
(()
=>
{
this
.
btn_voice
.
getComponent
(
ImgVoice
).
playVoiceEnd
();
this
.
startCreate
=
true
;
this
.
startCreate
=
true
;
pg
.
hw
.
playLocalAudio
(
'
countdown
'
,
true
).
then
((
id
)
=>
{
//
pg.hw.playLocalAudio('countdown', true).then((id) => {
this
.
loopId
=
id
;
//
this.loopId = id;
})
//
})
})
})
}
}
@
property
(
cc
.
Node
)
private
btn_voice
:
cc
.
Node
=
null
;
private
loopId
:
any
;
private
loopId
:
any
;
// 制造气泡
// 制造气泡
private
canTouch
:
boolean
;
private
canTouch
:
boolean
;
...
...
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