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
bfd1bb43
Commit
bfd1bb43
authored
Jul 10, 2023
by
Tt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改切换逻辑
parent
a3d7439a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
13 deletions
+30
-13
LayerRecord_hy01_danci.ts
assets/hy01_danci/common/script/LayerRecord_hy01_danci.ts
+15
-3
hy01_danci.fire
assets/hy01_danci/scene/hy01_danci.fire
+2
-2
hy01_danci.ts
assets/hy01_danci/scene/hy01_danci.ts
+13
-8
No files found.
assets/hy01_danci/common/script/LayerRecord_hy01_danci.ts
View file @
bfd1bb43
...
@@ -34,7 +34,7 @@ export default class LayerRecord extends cc.Component {
...
@@ -34,7 +34,7 @@ export default class LayerRecord extends cc.Component {
this
.
layout_record
.
active
=
true
;
this
.
layout_record
.
active
=
true
;
this
.
letter
=
data
.
letter
this
.
letter
=
data
.
letter
this
.
targetTime
=
data
.
targetTime
this
.
targetTime
=
data
.
targetTime
if
(
data
.
reset
)
{
if
(
data
.
reset
)
{
this
.
recordAudio
=
null
;
this
.
recordAudio
=
null
;
this
.
showPlay
();
this
.
showPlay
();
}
}
...
@@ -48,8 +48,9 @@ export default class LayerRecord extends cc.Component {
...
@@ -48,8 +48,9 @@ export default class LayerRecord extends cc.Component {
})
})
let
btn_record
=
pg
.
view
.
find
(
this
.
layout_record
,
'
btn_record
'
);
let
btn_record
=
pg
.
view
.
find
(
this
.
layout_record
,
'
btn_record
'
);
let
btn_play
=
pg
.
view
.
find
(
this
.
layout_record
,
'
btn_play
'
);
let
btn_play
=
pg
.
view
.
find
(
this
.
layout_record
,
'
btn_play
'
);
btn_record
.
on
(
cc
.
Node
.
EventType
.
TOUCH_START
,
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.onTouchRecordEnd, this);
btn_record
.
on
(
cc
.
Node
.
EventType
.
TOUCH_END
,
this
.
onTouchRecordClick
,
this
);
btn_play
.
on
(
cc
.
Node
.
EventType
.
TOUCH_END
,
this
.
onTouchPlayRecord
,
this
);
btn_play
.
on
(
cc
.
Node
.
EventType
.
TOUCH_END
,
this
.
onTouchPlayRecord
,
this
);
}
}
...
@@ -147,8 +148,18 @@ export default class LayerRecord extends cc.Component {
...
@@ -147,8 +148,18 @@ export default class LayerRecord extends cc.Component {
protected
update
(
dt
:
number
):
void
{
protected
update
(
dt
:
number
):
void
{
this
.
showTimeUpdate
();
this
.
showTimeUpdate
();
}
}
private
recording
:
boolean
;
onTouchRecordClick
()
{
if
(
this
.
recording
)
{
this
.
onTouchRecordEnd
();
}
else
{
this
.
onTouchRecord
();
}
}
//按钮触发,使用的方法
//按钮触发,使用的方法
async
onTouchRecord
()
{
async
onTouchRecord
()
{
this
.
recording
=
true
;
this
.
recordAudio
=
''
;
this
.
recordAudio
=
''
;
this
.
showPlay
();
this
.
showPlay
();
let
AniNode
=
pg
.
view
.
find
(
this
.
layout_record
,
'
AniNode
'
);
let
AniNode
=
pg
.
view
.
find
(
this
.
layout_record
,
'
AniNode
'
);
...
@@ -194,6 +205,7 @@ export default class LayerRecord extends cc.Component {
...
@@ -194,6 +205,7 @@ export default class LayerRecord extends cc.Component {
});
//结束录音
});
//结束录音
}
}
async
recrodEnd
(
data
)
{
async
recrodEnd
(
data
)
{
this
.
recording
=
false
;
this
.
recordAudio
=
data
.
audioUrl
;
this
.
recordAudio
=
data
.
audioUrl
;
this
.
showPlay
();
this
.
showPlay
();
let
score
=
data
.
result
.
overall
;
let
score
=
data
.
result
.
overall
;
...
...
assets/hy01_danci/scene/hy01_danci.fire
View file @
bfd1bb43
...
@@ -3812,7 +3812,7 @@
...
@@ -3812,7 +3812,7 @@
},
},
"_contentSize": {
"_contentSize": {
"__type__": "cc.Size",
"__type__": "cc.Size",
"width": 15
2.6
,
"width": 15
0.74
,
"height": 63
"height": 63
},
},
"_anchorPoint": {
"_anchorPoint": {
...
@@ -3898,7 +3898,7 @@
...
@@ -3898,7 +3898,7 @@
"__type__": "TypedArray",
"__type__": "TypedArray",
"ctor": "Float64Array",
"ctor": "Float64Array",
"array": [
"array": [
2
10.81399999999996
,
2
08.95399999999995
,
0,
0,
0,
0,
0,
0,
...
...
assets/hy01_danci/scene/hy01_danci.ts
View file @
bfd1bb43
...
@@ -196,12 +196,14 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -196,12 +196,14 @@ export default class SceneComponent extends MyCocosSceneComponent {
this
.
currentAudioId
=
null
;
this
.
currentAudioId
=
null
;
com
.
playVoiceEnd
();
com
.
playVoiceEnd
();
this
.
touchForbid
=
true
;
this
.
touchForbid
=
true
;
pg
.
event
.
once
(
'
layer_coin_show_coin_end
'
,
()
=>
{
this
.
touchForbid
=
false
;
this
.
touchForbid
=
false
;
this
.
nextLayer
();
this
.
nextLayer
();
// pg.event.once('layer_coin_show_coin_end', () => {
})
// 动画回调\
// this.touchForbid = false;
this
.
score
+=
3
;
// this.nextLayer();
pg
.
event
.
emit
(
'
layer_coin_show_coin
'
,
3
)
//1 2 3硬币数量
// }) // 动画回调\
// this.score += 3;
// pg.event.emit('layer_coin_show_coin', 3) //1 2 3硬币数量
},
(
audioId
)
=>
{
},
(
audioId
)
=>
{
this
.
currentAudioId
=
audioId
;
this
.
currentAudioId
=
audioId
;
})
})
...
@@ -263,7 +265,10 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -263,7 +265,10 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
}
preLayer
()
{
preLayer
()
{
// 积分需要计算,未获取的内容
// 积分需要计算,未获取的内容
if
(
!
this
.
LastData
)
return
;
if
(
!
this
.
LastData
)
{
this
.
touchForbid
=
false
;
return
;
}
this
.
tempCount
=
0
;
this
.
tempCount
=
0
;
cc
.
audioEngine
.
stopEffect
(
this
.
currentAudioId
);
cc
.
audioEngine
.
stopEffect
(
this
.
currentAudioId
);
pg
.
event
.
emit
(
'
img_voice_play_voice_end
'
);
pg
.
event
.
emit
(
'
img_voice_play_voice_end
'
);
...
@@ -277,7 +282,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
...
@@ -277,7 +282,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
this
.
scheduleOnce
(()
=>
{
this
.
scheduleOnce
(()
=>
{
this
.
count
--
;
this
.
count
--
;
this
.
startPlay
();
this
.
startPlay
();
},
3
)
},
1
)
}
}
nextLayer
()
{
nextLayer
()
{
this
.
touchForbid
=
true
;
this
.
touchForbid
=
true
;
...
...
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