Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hy01_danci
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
hy01_danci
Commits
2c21417e
Commit
2c21417e
authored
Jul 01, 2023
by
Tt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
录音重置
parent
66a10e81
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
60 additions
and
33 deletions
+60
-33
LayerRecord_hy01_danci.ts
assets/hy01_danci/common/script/LayerRecord_hy01_danci.ts
+9
-5
hy01_danci.fire
assets/hy01_danci/scene/hy01_danci.fire
+2
-2
hy01_danci.ts
assets/hy01_danci/scene/hy01_danci.ts
+8
-3
defaultData_hy01_danci.ts
assets/hy01_danci/script/defaultData_hy01_danci.ts
+41
-23
No files found.
assets/hy01_danci/common/script/LayerRecord_hy01_danci.ts
View file @
2c21417e
// pg.event.emit('layer_record_open', {
// letter: 'test',
// targetTime: 10
// })
import
pg
from
"
../../scene/pg_hy01_danci
"
;
const
{
ccclass
,
property
}
=
cc
.
_decorator
;
let
win
:
any
=
window
;
...
...
@@ -15,16 +21,13 @@ export default class LayerRecord extends cc.Component {
btn_play
.
active
=
false
;
this
.
initEvent
();
this
.
showVoiceWhite
();
pg
.
event
.
emit
(
'
layer_record_setting
'
,
{
letter
:
'
test
'
,
targetTime
:
10
})
}
private
letter
:
string
;
private
targetTime
:
number
;
private
recordAudio
:
string
;
initEvent
()
{
pg
.
event
.
on
(
'
layer_record_setting
'
,
(
data
)
=>
{
pg
.
event
.
on
(
'
layer_record_open
'
,
(
data
)
=>
{
this
.
layout_record
.
active
=
true
;
this
.
letter
=
data
.
letter
this
.
targetTime
=
data
.
targetTime
})
...
...
@@ -177,6 +180,7 @@ export default class LayerRecord extends cc.Component {
this
.
recordAudio
=
data
.
audioUrl
;
this
.
showPlay
();
let
score
=
data
.
result
.
overall
;
this
.
layout_record
.
active
=
false
;
pg
.
event
.
emit
(
'
layer_record_score
'
,
score
);
}
}
...
...
assets/hy01_danci/scene/hy01_danci.fire
View file @
2c21417e
...
...
@@ -6305,7 +6305,7 @@
"__id__": 158
}
],
"_active":
fals
e,
"_active":
tru
e,
"_components": [
{
"__id__": 194
...
...
@@ -6394,7 +6394,7 @@
"__id__": 177
}
],
"_active":
tru
e,
"_active":
fals
e,
"_components": [
{
"__id__": 192
...
...
assets/hy01_danci/scene/hy01_danci.ts
View file @
2c21417e
...
...
@@ -109,7 +109,10 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
startPlay
()
{
if
(
this
.
recordFlag
)
{
this
.
layer_record
.
active
=
true
;
pg
.
event
.
emit
(
'
layer_record_open
'
,
{
letter
:
this
.
CurrentData
.
content
,
targetTime
:
this
.
CurrentData
.
duration
})
}
else
{
if
(
this
.
CurrentData
.
type
.
indexOf
(
'
audio
'
)
>
-
1
)
{
pg
.
event
.
emit
(
'
img_voice_play_voice_start
'
)
...
...
@@ -125,7 +128,6 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
}
onRecorScore
(
score
)
{
this
.
layer_record
.
active
=
false
;
if
(
score
<
10
)
{
pg
.
event
.
once
(
'
layer_right_show_tryagain_end
'
,
()
=>
{
this
.
tempScore
+=
1
;
...
...
@@ -138,7 +140,10 @@ export default class SceneComponent extends MyCocosSceneComponent {
pg
.
event
.
emit
(
'
layer_coin_show_coin
'
,
1
)
//1 2 3硬币数量
}
else
{
if
(
this
.
recordFlag
)
{
this
.
layer_record
.
active
=
true
;
pg
.
event
.
emit
(
'
layer_record_open
'
,
{
letter
:
this
.
CurrentData
.
content
,
targetTime
:
this
.
CurrentData
.
duration
})
}
}
})
...
...
assets/hy01_danci/script/defaultData_hy01_danci.ts
View file @
2c21417e
export
const
defaultData
=
{
"
recordFlag
"
:
true
,
"
title
"
:
"
test
"
,
"
audio_url
"
:
''
,
npcTitle
:
"
I show info
"
,
npcAudio
:
"
http://staging-teach.cdn.ireadabc.com/43839adb578c7e01456748b8a176a0c3_l.mp3
"
,
"
title
"
:
""
,
"
questionText
"
:
""
,
"
questionTextAudio
"
:
""
,
"
questions
"
:
[
{
"
questionAudio
"
:
""
,
"
duration
"
:
120
,
"
options
"
:
[
{
"
type
"
:
"
img_audio
"
,
"
image
"
:
"
http://staging-teach.cdn.ireadabc.com/875862129c75a075b3d710f541258a00.png
"
,
"
audio
"
:
"
http://staging-teach.cdn.ireadabc.com/43839adb578c7e01456748b8a176a0c3_l.mp3
"
,
"
text
"
:
""
,
"
duration
"
:
10
,
"
content
"
:
"
egg
"
,
"
right
"
:
false
},
{
"
type
"
:
"
img_txt_audio
"
,
"
image
"
:
"
http://staging-teach.cdn.ireadabc.com/011cf423d6fd8760e810644ca6070e34.png
"
,
"
audio
"
:
"
http://staging-teach.cdn.ireadabc.com/43839adb578c7e01456748b8a176a0c3_l.mp3
"
,
"
text
"
:
"
hammer
"
,
"
duration
"
:
10
,
"
content
"
:
"
hammer
"
,
"
right
"
:
false
},
{
"
type
"
:
"
img_txt_audio
"
,
"
image
"
:
"
http://staging-teach.cdn.ireadabc.com/befdc1801d93fd95b3a8ee7c7a2d2d05.png
"
,
"
audio
"
:
"
http://staging-teach.cdn.ireadabc.com/43839adb578c7e01456748b8a176a0c3_l.mp3
"
,
"
text
"
:
"
clound
"
,
"
duration
"
:
10
,
"
content
"
:
"
clound
"
,
"
right
"
:
false
,
"
audioName
"
:
"
敲碎蛋的声音.mp3
"
}]
}],
"
bgAudio
"
:
""
,
"
bgAudioName
"
:
""
,
"
audioName
"
:
""
"
questionAudio
"
:
""
,
"
duration
"
:
120
,
"
options
"
:
[{
"
type
"
:
"
img
"
,
"
image
"
:
"
http://staging-teach.cdn.ireadabc.com/09670073e1cbb685cf03e29958133c99.png
"
,
"
audio
"
:
""
,
"
text
"
:
""
,
"
duration
"
:
100
,
"
content
"
:
"
ceshi
"
,
"
right
"
:
false
},
{
"
type
"
:
"
img_txt
"
,
"
image
"
:
"
http://staging-teach.cdn.ireadabc.com/b0b3c59954a6b8610182ef1fc5ba90c5.png
"
,
"
audio
"
:
""
,
"
text
"
:
"
test
"
,
"
duration
"
:
10
,
"
content
"
:
"
test
"
,
"
right
"
:
false
}]
}],
"
bgAudio
"
:
""
,
"
bgAudioName
"
:
""
,
"
audioName
"
:
""
,
"
npcTitle
"
:
"
123
"
,
"
npcAudio
"
:
"
http://staging-teach.cdn.ireadabc.com/f96fcb73dc6b3dcf2ce71fe2ba76e4c3_l.mp3
"
,
"
npcAudioName
"
:
"
选项正确.mp3
"
}
// {
// "recordFlag": true,
// "title": "test",
// "audio_url": '',
// npcTitle: "I show info",
// npcAudio: "http://staging-teach.cdn.ireadabc.com/43839adb578c7e01456748b8a176a0c3_l.mp3",
// "questionText": "",
// "questionTextAudio": "",
// "questions": [
// {
// "questionAudio": "",
// "duration": 120,
// "options": [
// {
// "type": "img_audio",
// "image": "http://staging-teach.cdn.ireadabc.com/875862129c75a075b3d710f541258a00.png",
// "audio": "http://staging-teach.cdn.ireadabc.com/43839adb578c7e01456748b8a176a0c3_l.mp3",
// "text": "", "duration": 10, "content": "egg", "right": false
// },
// {
// "type": "img_txt_audio", "image": "http://staging-teach.cdn.ireadabc.com/011cf423d6fd8760e810644ca6070e34.png", "audio": "http://staging-teach.cdn.ireadabc.com/43839adb578c7e01456748b8a176a0c3_l.mp3", "text": "hammer", "duration": 10, "content": "hammer", "right": false
// },
// {
// "type": "img_txt_audio", "image": "http://staging-teach.cdn.ireadabc.com/befdc1801d93fd95b3a8ee7c7a2d2d05.png", "audio": "http://staging-teach.cdn.ireadabc.com/43839adb578c7e01456748b8a176a0c3_l.mp3", "text": "clound", "duration": 10, "content": "clound", "right": false, "audioName": "敲碎蛋的声音.mp3"
// }]
// }],
// "bgAudio": "",
// "bgAudioName": "",
// "audioName": ""
// }
// {
// "recordFlag": true,
// "title": "test",
...
...
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