Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hy03_zadan
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
hy03_zadan
Commits
9db2a3fa
Commit
9db2a3fa
authored
Jul 11, 2023
by
yu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
ecd7466f
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
1265 additions
and
1151 deletions
+1265
-1151
ImgVoice_hy03_zadan.ts
assets/hy03_zadan/common/script/ImgVoice_hy03_zadan.ts
+4
-0
LayerRecord_hy03_zadan.ts
assets/hy03_zadan/common/script/LayerRecord_hy03_zadan.ts
+20
-12
STYuantiSCBold03.ttf
assets/hy03_zadan/fonts/STYuantiSCBold03.ttf
+0
-0
STYuantiSCBold03.ttf.meta
assets/hy03_zadan/fonts/STYuantiSCBold03.ttf.meta
+5
-0
hy03_zadan.fire
assets/hy03_zadan/scene/hy03_zadan.fire
+1233
-1137
hy03_zadan.ts
assets/hy03_zadan/scene/hy03_zadan.ts
+3
-2
No files found.
assets/hy03_zadan/common/script/ImgVoice_hy03_zadan.ts
View file @
9db2a3fa
...
...
@@ -32,6 +32,10 @@ export default class ImgVoice extends cc.Component {
this
.
schedule
(
this
.
playVoiceRunning
,
0.3
)
}
playVoiceRunning
()
{
if
(
!
this
.
img_npc_voice
)
{
this
.
unschedule
(
this
.
playVoiceRunning
);
return
;
}
this
.
playVoiceCount
++
;
let
p1
=
this
.
img_npc_voice
.
getChildByName
(
'
p1
'
)
let
p2
=
this
.
img_npc_voice
.
getChildByName
(
'
p2
'
)
...
...
assets/hy03_zadan/common/script/LayerRecord_hy03_zadan.ts
View file @
9db2a3fa
// pg.event.emit('layer_record_open', {
// letter: 'test',
// targetTime: 10
// targetTime: 10,
// reset : false
// })
// pg.event.emit('layer_record_close')
//pg.event.on('layer_record_start_record',()=>{});
//pg.event.on('layer_record_end_record',()=>{});
import
pg
from
"
../../scene/tool/pg_hy03_zadan
"
;
const
{
ccclass
,
property
}
=
cc
.
_decorator
;
let
win
:
any
=
window
;
...
...
@@ -24,17 +26,19 @@ export default class LayerRecord extends cc.Component {
btn_play
.
active
=
false
;
this
.
initEvent
();
this
.
showVoiceWhite
();
this
.
recording
=
false
;
}
private
letter
:
string
;
private
targetTime
:
number
;
private
recordAudio
:
string
;
private
recording
;
initEvent
()
{
pg
.
event
.
on
(
'
layer_record_open
'
,
(
data
)
=>
{
this
.
layout_record
.
active
=
true
;
this
.
letter
=
data
.
letter
this
.
targetTime
=
data
.
targetTime
if
(
data
.
reset
)
{
this
.
recordAudio
=
null
;
this
.
showPlay
();
}
})
pg
.
event
.
on
(
'
layer_record_close
'
,
(
data
)
=>
{
this
.
layout_record
.
active
=
false
;
...
...
@@ -45,8 +49,9 @@ export default class LayerRecord extends cc.Component {
})
let
btn_record
=
pg
.
view
.
find
(
this
.
layout_record
,
'
btn_record
'
);
let
btn_play
=
pg
.
view
.
find
(
this
.
layout_record
,
'
btn_play
'
);
btn_record
.
on
(
cc
.
Node
.
EventType
.
TOUCH_END
,
this
.
onTouchRecord
,
this
);
// btn_record.on(cc.Node.EventType.TOUCH_START
, this.onTouchRecord, this);
// btn_record.on(cc.Node.EventType.TOUCH_END, this.onTouchRecordEnd, this);
btn_record
.
on
(
cc
.
Node
.
EventType
.
TOUCH_END
,
this
.
onTouchRecordClick
,
this
);
btn_play
.
on
(
cc
.
Node
.
EventType
.
TOUCH_END
,
this
.
onTouchPlayRecord
,
this
);
}
...
...
@@ -70,8 +75,6 @@ export default class LayerRecord extends cc.Component {
record_time
.
getComponent
(
cc
.
Sprite
).
fillRange
=
percent
;
if
(
percent
==
0
)
{
this
.
showTimeEnd
();
this
.
onTouchRecordEnd
();
this
.
recording
=
false
;
}
}
showTimeEnd
()
{
...
...
@@ -146,13 +149,17 @@ export default class LayerRecord extends cc.Component {
protected
update
(
dt
:
number
):
void
{
this
.
showTimeUpdate
();
}
//按钮触发,使用的方法
async
onTouchRecord
()
{
if
(
this
.
recording
){
private
recording
:
boolean
;
onTouchRecordClick
()
{
if
(
this
.
recording
)
{
this
.
onTouchRecordEnd
();
this
.
recording
=
false
;
return
;
}
else
{
this
.
onTouchRecord
()
;
}
}
//按钮触发,使用的方法
async
onTouchRecord
()
{
this
.
recording
=
true
;
this
.
recordAudio
=
''
;
this
.
showPlay
();
...
...
@@ -199,6 +206,7 @@ export default class LayerRecord extends cc.Component {
});
//结束录音
}
async
recrodEnd
(
data
)
{
this
.
recording
=
false
;
this
.
recordAudio
=
data
.
audioUrl
;
this
.
showPlay
();
let
score
=
data
.
result
.
overall
;
...
...
assets/hy03_zadan/fonts/STYuantiSCBold03.ttf
0 → 100644
View file @
9db2a3fa
File added
assets/hy03_zadan/fonts/STYuantiSCBold03.ttf.meta
0 → 100644
View file @
9db2a3fa
{
"ver": "1.1.0",
"uuid": "d23a8ad9-9272-4969-b238-60ef42f16e67",
"subMetas": {}
}
\ No newline at end of file
assets/hy03_zadan/scene/hy03_zadan.fire
View file @
9db2a3fa
This source diff could not be displayed because it is too large. You can
view the blob
instead.
assets/hy03_zadan/scene/hy03_zadan.ts
View file @
9db2a3fa
...
...
@@ -139,7 +139,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
else
{
pg
.
event
.
emit
(
'
layer_record_open
'
,
{
letter
:
self
.
touchData
.
txt
,
targetTime
:
self
.
touchData
.
time
targetTime
:
self
.
touchData
.
time
,
reset
:
false
})
}
})
...
...
@@ -208,7 +209,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
broken
.
active
=
true
;
await
pg
.
time
.
delay
(
1
);
this
.
playCard
(
this
.
touchData
);
pg
.
event
.
emit
(
"
layer_record_open
"
,
{
letter
:
eggData
.
txt
,
targetTime
:
eggData
.
time
});
pg
.
event
.
emit
(
"
layer_record_open
"
,
{
letter
:
eggData
.
txt
,
targetTime
:
eggData
.
time
,
reset
:
true
});
})
});
this
.
eggArrowAction
(
egg
);
...
...
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