Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dg29_museum
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
dg29_museum
Commits
e5fd1484
Commit
e5fd1484
authored
Dec 26, 2023
by
Tt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
上传修改内容
parent
ae5fa172
Changes
2
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
453 additions
and
353 deletions
+453
-353
dg29_museum.fire
assets/dg29_museum/scene/dg29_museum.fire
+429
-343
dg29_museum.ts
assets/dg29_museum/scene/dg29_museum.ts
+24
-10
No files found.
assets/dg29_museum/scene/dg29_museum.fire
View file @
e5fd1484
This diff is collapsed.
Click to expand it.
assets/dg29_museum/scene/dg29_museum.ts
View file @
e5fd1484
...
...
@@ -63,6 +63,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
@
property
(
cc
.
Node
)
question_img
:
cc
.
Node
=
null
;
@
property
(
cc
.
Node
)
label_title
:
cc
.
Node
=
null
;
@
property
(
cc
.
Node
)
btn_vioce
:
cc
.
Node
=
null
;
@
property
(
cc
.
Node
)
btn_vioce_ing
:
cc
.
Node
=
null
;
@
property
(
cc
.
Node
)
btn_restart
:
cc
.
Node
=
null
;
@
property
(
cc
.
Node
)
label_tip_wait
:
cc
.
Node
=
null
;
@
property
(
cc
.
Node
)
label_tip_ing
:
cc
.
Node
=
null
;
...
...
@@ -72,6 +73,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
// 初始化页面
initView
()
{
this
.
btn_vioce
.
active
=
false
;
this
.
btn_vioce_ing
.
active
=
false
;
this
.
btn_restart
.
active
=
false
;
this
.
label_tip_wait
.
active
=
false
;
this
.
label_tip_ing
.
active
=
false
;
...
...
@@ -83,7 +85,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
pg
.
view
.
touchOn
(
this
.
btn_go
,
this
.
onTouchNext
,
this
);
pg
.
view
.
touchOn
(
this
.
btn_restart
,
this
.
onTouchRestart
,
this
);
pg
.
view
.
touchOn
(
this
.
btn_vioce
,
this
.
onTouchRecord
,
this
);
pg
.
view
.
touchOn
(
pg
.
view
.
find
(
this
.
btn_vioce
,
'
img_ing
'
)
,
this
.
onTouchRecordEnd
,
this
);
pg
.
view
.
touchOn
(
this
.
btn_vioce_ing
,
this
.
onTouchRecordEnd
,
this
);
}
// 初始化游戏
initGame
()
{
...
...
@@ -110,8 +112,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
pg
.
view
.
setString
(
this
.
label_title
,
this
.
currentQuestion
.
title
);
this
.
btn_vioce
.
active
=
true
;
pg
.
view
.
visible
(
pg
.
view
.
find
(
this
.
btn_vioce
,
'
img_ing
'
),
false
)
pg
.
view
.
visible
(
pg
.
view
.
find
(
this
.
btn_vioce
,
'
img_stop
'
),
false
)
pg
.
view
.
visible
(
this
.
btn_vioce_ing
,
false
)
this
.
label_tip_wait
.
active
=
true
;
// 展示下一题
...
...
@@ -125,7 +126,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
this
.
_cantouch
=
false
;
if
(
this
.
current
==
0
)
{
this
.
xiaodi
.
playEnter
(
this
.
data
.
startAudio
).
then
(()
=>
{
this
.
xiaodi
.
playEnter
(
this
.
currentQuestion
.
startAudio
).
then
(()
=>
{
this
.
_cantouch
=
true
;
})
}
else
{
...
...
@@ -158,9 +159,8 @@ export default class SceneComponent extends MyCocosSceneComponent {
this
.
label_tip_wait
.
active
=
false
this
.
label_tip_ing
.
active
=
true
;
pg
.
view
.
visible
(
pg
.
view
.
find
(
this
.
btn_vioce
,
'
img_ing
'
),
true
)
pg
.
view
.
visible
(
pg
.
view
.
find
(
this
.
btn_vioce
,
'
img_stop
'
),
true
)
let
img_ing
=
pg
.
view
.
find
(
this
.
btn_vioce
,
'
img_ing
'
)
pg
.
view
.
visible
(
this
.
btn_vioce_ing
,
true
)
let
img_ing
=
pg
.
view
.
find
(
this
.
btn_vioce_ing
,
'
img_ing
'
)
img_ing
.
getComponent
(
cc
.
Sprite
).
fillRange
=
subTime
/
this
.
targetTime
;
if
(
subTime
==
0
)
{
this
.
onTouchRecordEnd
();
...
...
@@ -170,8 +170,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
this
.
startTime
=
null
;
this
.
label_tip_wait
.
active
=
false
this
.
label_tip_ing
.
active
=
false
;
pg
.
view
.
visible
(
pg
.
view
.
find
(
this
.
btn_vioce
,
'
img_ing
'
),
false
)
pg
.
view
.
visible
(
pg
.
view
.
find
(
this
.
btn_vioce
,
'
img_stop
'
),
false
)
pg
.
view
.
visible
(
this
.
btn_vioce_ing
,
false
)
}
async
onTouchRecord
()
{
if
(
!
this
.
_cantouch
)
return
;
...
...
@@ -188,6 +187,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
}
async
onTouchRecordEnd
()
{
if
(
!
this
.
recording
)
return
;
this
.
recording
=
false
;
this
.
showTimeEnd
();
let
testData
=
{
"
text
"
:
"
Hello every one my name is world
"
,
...
...
@@ -258,6 +258,7 @@ export default class SceneComponent extends MyCocosSceneComponent {
})
}
onTouchNext
()
{
console
.
log
(
'
next
'
)
if
(
this
.
recording
)
return
;
if
(
!
this
.
nextQuestion
)
{
pg
.
view
.
find
(
this
,
'
layout_game/img_question
'
).
active
=
false
;
...
...
@@ -305,11 +306,24 @@ export default class SceneComponent extends MyCocosSceneComponent {
this
.
xiaodi
.
hideAll
();
}
showVideoPlayer
()
{
@
property
(
cc
.
Node
)
video_canvas
:
cc
.
Node
=
null
;
hideVideoPlayer
()
{
this
.
layout_video
.
active
=
true
;
this
.
videoPlayer
.
stayOnBottom
=
true
;
this
.
videoPlayer
.
node
.
x
=
0
;
this
.
videoPlayer
.
node
.
y
=
0
;
this
.
videoPlayer
.
node
.
width
=
100
;
this
.
videoPlayer
.
node
.
height
=
100
;
}
showVideoPlayer
()
{
this
.
layout_video
.
active
=
true
;
this
.
videoPlayer
.
stayOnBottom
=
true
;
this
.
videoPlayer
.
node
.
x
=
this
.
video_canvas
.
x
;
this
.
videoPlayer
.
node
.
y
=
this
.
video_canvas
.
y
;
this
.
videoPlayer
.
node
.
width
=
this
.
video_canvas
.
width
;
this
.
videoPlayer
.
node
.
height
=
this
.
video_canvas
.
height
;
if
(
!
this
.
_isReadyToPlay
)
{
//首次播放
this
.
_isReadyToPlay
=
false
;
...
...
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